{
  "openapi": "3.1.0",
  "info": {
    "title": "Nicia API",
    "version": "v1",
    "description": "HTTP API for invoking Nicia agents — start runs, get output, stream, and receive completion webhooks. Authenticate with an API key in the `x-api-key` header."
  },
  "servers": [
    {
      "url": "https://api.nicia.ai",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "AccessRequest"
    },
    {
      "name": "Activity"
    },
    {
      "name": "Admin"
    },
    {
      "name": "Agent"
    },
    {
      "name": "AgentConnectorBinding"
    },
    {
      "name": "App"
    },
    {
      "name": "Artifact"
    },
    {
      "name": "ArtifactFolder"
    },
    {
      "name": "ArtifactSource"
    },
    {
      "name": "Automation"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Brain"
    },
    {
      "name": "BrainArtifactExtraction"
    },
    {
      "name": "BrainConnection"
    },
    {
      "name": "BrainConnectionWebhook"
    },
    {
      "name": "BrainExport"
    },
    {
      "name": "BrainLiveDataPlane"
    },
    {
      "name": "BrainPolicyPlane"
    },
    {
      "name": "BrainProfilePlane"
    },
    {
      "name": "BrainReviewPlane"
    },
    {
      "name": "BrainV2"
    },
    {
      "name": "BrainV2Document"
    },
    {
      "name": "BrainV2Govern"
    },
    {
      "name": "BrainV2Key"
    },
    {
      "name": "BrainV2Read"
    },
    {
      "name": "BrainV2Record"
    },
    {
      "name": "ChangeSet"
    },
    {
      "name": "Connector"
    },
    {
      "name": "Conversation"
    },
    {
      "name": "Coordinator"
    },
    {
      "name": "Corpus"
    },
    {
      "name": "Eval"
    },
    {
      "name": "Goal"
    },
    {
      "name": "HumanInput"
    },
    {
      "name": "KnowledgeBundle"
    },
    {
      "name": "KnowledgeTrigger"
    },
    {
      "name": "ManagementKeyV2"
    },
    {
      "name": "Notification"
    },
    {
      "name": "Operation"
    },
    {
      "name": "Pack"
    },
    {
      "name": "Preview"
    },
    {
      "name": "Project"
    },
    {
      "name": "ProviderCredential"
    },
    {
      "name": "Query"
    },
    {
      "name": "RubricTemplate"
    },
    {
      "name": "Run"
    },
    {
      "name": "RunTask"
    },
    {
      "name": "Sandbox"
    },
    {
      "name": "Schedule"
    },
    {
      "name": "Schema"
    },
    {
      "name": "Search"
    },
    {
      "name": "SharedRun"
    },
    {
      "name": "Skill"
    },
    {
      "name": "Template"
    },
    {
      "name": "Toolset"
    },
    {
      "name": "TraceDistillation"
    },
    {
      "name": "Webhook"
    },
    {
      "name": "Workflow"
    },
    {
      "name": "Workspace"
    }
  ],
  "paths": {
    "/v1/access-requests": {
      "post": {
        "operationId": "AccessRequest_submit",
        "tags": [
          "AccessRequest"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "submitted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "submitted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/activity": {
      "get": {
        "operationId": "Activity_list",
        "tags": [
          "Activity"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tool_call",
                "llm_call",
                "system_action"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "succeeded",
                "failed",
                "abandoned"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operations": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "tool_call"
                                  },
                                  "toolSourceKind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "skill",
                                      "builtin"
                                    ]
                                  },
                                  "toolSourceId": {
                                    "type": "string"
                                  },
                                  "toolSourceVersionId": {
                                    "type": "string"
                                  },
                                  "toolName": {
                                    "type": "string"
                                  },
                                  "toolSchemaHash": {
                                    "type": "string"
                                  },
                                  "toolInputSchemaSnapshot": {},
                                  "toolOutputSchemaSnapshot": {}
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type",
                                  "toolSourceKind",
                                  "toolSourceId",
                                  "toolName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "llm_call"
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "system_action"
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "operations"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/admin/billing-tier": {
      "put": {
        "operationId": "Admin_setBillingTier",
        "tags": [
          "Admin"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tier": {
                    "type": "string",
                    "enum": [
                      "free",
                      "business",
                      "enterprise",
                      "staff"
                    ]
                  }
                },
                "required": [
                  "tenantId",
                  "tier"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "tenantId": {
                          "type": "string"
                        },
                        "tier": {
                          "type": "string",
                          "enum": [
                            "free",
                            "business",
                            "enterprise",
                            "staff"
                          ]
                        }
                      },
                      "required": [
                        "tenantId",
                        "tier"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/admin/invitation-codes": {
      "get": {
        "operationId": "Admin_listInvitationCodes",
        "tags": [
          "Admin"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "codes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "label": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "maxUses": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "useCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "expiresAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdBy": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "label",
                              "maxUses",
                              "useCount",
                              "expiresAt",
                              "createdBy",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "codes"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Admin_createInvitationCode",
        "tags": [
          "Admin"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "maxUses": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "label": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "maxUses": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "useCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "expiresAt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdBy": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "code",
                            "label",
                            "maxUses",
                            "useCount",
                            "expiresAt",
                            "createdBy",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/admin/invitation-codes/{code}": {
      "delete": {
        "operationId": "Admin_deleteInvitationCode",
        "tags": [
          "Admin"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/admin/events": {
      "get": {
        "operationId": "Admin_listEvents",
        "tags": [
          "Admin"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "access_request",
                "signup"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "access_request",
                                  "signup"
                                ]
                              },
                              "summary": {
                                "type": "string"
                              },
                              "detail": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "access_request"
                                      },
                                      "email": {
                                        "type": "string"
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "email"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "signup"
                                      },
                                      "email": {
                                        "type": "string"
                                      },
                                      "userId": {
                                        "type": "string"
                                      },
                                      "inviteCode": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "email",
                                      "userId"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "notificationType": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "notificationSent": {
                                "type": "boolean"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "summary",
                              "detail",
                              "notificationType",
                              "notificationSent",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "events"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/triggers": {
      "get": {
        "operationId": "Automation_triggers",
        "tags": [
          "Automation"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "triggers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "trigger": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "knowledgeGraphId": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "expectedOutcome": {
                                    "type": "string"
                                  },
                                  "requiredAccess": {
                                    "type": "string",
                                    "enum": [
                                      "read_only",
                                      "read_write"
                                    ]
                                  },
                                  "enabled": {
                                    "type": "boolean"
                                  },
                                  "kindScopes": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "entityKind": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "changeTypes": {
                                          "minItems": 1,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "created",
                                              "updated",
                                              "deleted"
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "changeTypes"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "conditions": {
                                    "type": "array",
                                    "items": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "edge_count"
                                            },
                                            "edge": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "gte",
                                                "eq",
                                                "lte"
                                              ]
                                            },
                                            "value": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "edge",
                                            "op",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "property"
                                            },
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "exists",
                                                "contains"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "path",
                                            "op"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "inputTemplate": {
                                    "type": "string"
                                  },
                                  "cooldownMinutes": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "dailyCap": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "maxCausationDepth": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "pausedAt": {
                                    "type": "string"
                                  },
                                  "pausedReason": {
                                    "type": "string"
                                  },
                                  "lastTestedFingerprint": {
                                    "type": "string"
                                  },
                                  "lastTestRunId": {
                                    "type": "string"
                                  },
                                  "lastTestOutcome": {
                                    "type": "string",
                                    "enum": [
                                      "passed",
                                      "failed"
                                    ]
                                  },
                                  "lastTestSettledAt": {
                                    "type": "string"
                                  },
                                  "lastTestPassedAt": {
                                    "type": "string"
                                  },
                                  "firesToday": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "createdAt": {
                                    "type": "string"
                                  },
                                  "updatedAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "knowledgeGraphId",
                                  "agentId",
                                  "name",
                                  "enabled",
                                  "kindScopes",
                                  "conditions",
                                  "inputTemplate",
                                  "cooldownMinutes",
                                  "dailyCap",
                                  "maxCausationDepth",
                                  "firesToday",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "lastFire": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "triggerId": {
                                    "type": "string"
                                  },
                                  "eventId": {
                                    "type": "string"
                                  },
                                  "knowledgeGraphId": {
                                    "type": "string"
                                  },
                                  "entitySlug": {
                                    "type": "string"
                                  },
                                  "entityNodeId": {
                                    "type": "string"
                                  },
                                  "runId": {
                                    "type": "string"
                                  },
                                  "causationDepth": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "dispatching",
                                      "fired",
                                      "failed"
                                    ]
                                  },
                                  "failureReason": {
                                    "type": "string"
                                  },
                                  "firedAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "triggerId",
                                  "eventId",
                                  "knowledgeGraphId",
                                  "entitySlug",
                                  "causationDepth",
                                  "status",
                                  "firedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "trigger",
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "agentId",
                              "agentName"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "triggers"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/bindings": {
      "get": {
        "operationId": "Automation_bindings",
        "tags": [
          "Automation"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brains": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "agents": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "agentId": {
                                      "type": "string"
                                    },
                                    "agentName": {
                                      "type": "string"
                                    },
                                    "queryMode": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "agentId",
                                    "agentName",
                                    "queryMode"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "agents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "brains"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/flow": {
      "get": {
        "operationId": "Automation_flow",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "knowledgeGraphId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "flow": {
                          "type": "object",
                          "properties": {
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "knowledgeGraphName": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "writer",
                                      "entity_kind",
                                      "trigger",
                                      "reactor"
                                    ]
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "sublabel": {
                                    "type": "string"
                                  },
                                  "refId": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "enabled",
                                      "disabled",
                                      "paused"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "label"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "fromId": {
                                    "type": "string"
                                  },
                                  "toId": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "captures",
                                      "watched_by",
                                      "dispatches",
                                      "continues"
                                    ]
                                  }
                                },
                                "required": [
                                  "fromId",
                                  "toId",
                                  "kind"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "knowledgeGraphId",
                            "knowledgeGraphName",
                            "nodes",
                            "edges"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "flow"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/chain": {
      "get": {
        "operationId": "Automation_chain",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "chain": {
                          "type": "object",
                          "properties": {
                            "rootRunId": {
                              "type": "string"
                            },
                            "anchorRunId": {
                              "type": "string"
                            },
                            "steps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string"
                                  },
                                  "depth": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "agentName": {
                                    "type": "string"
                                  },
                                  "runState": {
                                    "type": "string"
                                  },
                                  "runTitle": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string"
                                  },
                                  "producedBy": {
                                    "type": "object",
                                    "properties": {
                                      "triggerId": {
                                        "type": "string"
                                      },
                                      "triggerName": {
                                        "type": "string"
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string"
                                      },
                                      "knowledgeGraphName": {
                                        "type": "string"
                                      },
                                      "entitySlug": {
                                        "type": "string"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "changeType": {
                                        "type": "string",
                                        "enum": [
                                          "created",
                                          "updated",
                                          "deleted"
                                        ]
                                      },
                                      "firedAt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "triggerId",
                                      "knowledgeGraphId",
                                      "entitySlug",
                                      "changeType",
                                      "firedAt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "runId",
                                  "depth",
                                  "runState"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "truncated": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "rootRunId",
                            "anchorRunId",
                            "steps",
                            "truncated"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "chain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain": {
      "get": {
        "operationId": "Automation_brainList",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "knowledgeGraphId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "knowledge_trigger",
                                  "schedule"
                                ]
                              },
                              "id": {
                                "type": "string"
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "expectedOutcome": {
                                "type": "string"
                              },
                              "requiredAccess": {
                                "type": "string",
                                "enum": [
                                  "read_only",
                                  "read_write"
                                ]
                              },
                              "fingerprint": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "testing",
                                  "failed",
                                  "ready",
                                  "active",
                                  "paused"
                                ]
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "pausedReason": {
                                "type": "string"
                              },
                              "lastTestRunId": {
                                "type": "string"
                              },
                              "lastTestPassedAt": {
                                "type": "string"
                              },
                              "proposal": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "number",
                                        "const": 1
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "agentId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120
                                      },
                                      "expectedOutcome": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 2000
                                      },
                                      "requiredAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "targetAutomationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "baseFingerprint": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "kind": {
                                        "type": "string",
                                        "const": "on_change"
                                      },
                                      "kindScopes": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "changeTypes": {
                                              "minItems": 1,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "created",
                                                  "updated",
                                                  "deleted"
                                                ]
                                              }
                                            }
                                          },
                                          "required": [
                                            "changeTypes"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "conditions": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "edge_count"
                                                },
                                                "edge": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "gte",
                                                    "eq",
                                                    "lte"
                                                  ]
                                                },
                                                "value": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "edge",
                                                "op",
                                                "value"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "property"
                                                },
                                                "path": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "exists",
                                                    "contains"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "path",
                                                "op"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "inputTemplate": {
                                        "default": "",
                                        "type": "string",
                                        "maxLength": 4000
                                      },
                                      "cooldownMinutes": {
                                        "default": 15,
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "dailyCap": {
                                        "default": 500,
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCausationDepth": {
                                        "default": 3,
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "knowledgeGraphId",
                                      "agentId",
                                      "name",
                                      "expectedOutcome",
                                      "requiredAccess",
                                      "kind",
                                      "kindScopes",
                                      "conditions",
                                      "inputTemplate",
                                      "cooldownMinutes",
                                      "dailyCap",
                                      "maxCausationDepth"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "number",
                                        "const": 1
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "agentId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "name": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120
                                      },
                                      "expectedOutcome": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 2000
                                      },
                                      "requiredAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "targetAutomationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "baseFingerprint": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "kind": {
                                        "type": "string",
                                        "const": "on_schedule"
                                      },
                                      "cronExpression": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeZone": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "$ref": "#/$defs/__schema0"
                                        }
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "knowledgeGraphId",
                                      "agentId",
                                      "name",
                                      "expectedOutcome",
                                      "requiredAccess",
                                      "kind",
                                      "cronExpression",
                                      "timeZone",
                                      "input"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "knowledgeGraphId",
                              "agentId",
                              "name",
                              "expectedOutcome",
                              "requiredAccess",
                              "fingerprint",
                              "state",
                              "enabled",
                              "proposal"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "automationKind": {
                                "type": "string",
                                "enum": [
                                  "knowledge_trigger",
                                  "schedule"
                                ]
                              },
                              "automationId": {
                                "type": "string"
                              },
                              "automationName": {
                                "type": "string"
                              },
                              "action": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "updated",
                                  "test_started",
                                  "test_passed",
                                  "test_failed",
                                  "activated",
                                  "first_fired",
                                  "paused",
                                  "auto_paused",
                                  "resumed",
                                  "deleted"
                                ]
                              },
                              "actorKind": {
                                "type": "string"
                              },
                              "actorId": {
                                "type": "string"
                              },
                              "producingRunId": {
                                "type": "string"
                              },
                              "testRunId": {
                                "type": "string"
                              },
                              "changeSetId": {
                                "type": "string"
                              },
                              "occurredAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "automationKind",
                              "automationId",
                              "automationName",
                              "action",
                              "actorKind",
                              "occurredAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "automations",
                        "events"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/preview": {
      "post": {
        "operationId": "Automation_preview",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "sampleEventId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "preview": {
                          "type": "object",
                          "properties": {
                            "automation": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "knowledge_trigger",
                                    "schedule"
                                  ]
                                },
                                "id": {
                                  "type": "string"
                                },
                                "knowledgeGraphId": {
                                  "type": "string"
                                },
                                "agentId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "expectedOutcome": {
                                  "type": "string"
                                },
                                "requiredAccess": {
                                  "type": "string",
                                  "enum": [
                                    "read_only",
                                    "read_write"
                                  ]
                                },
                                "fingerprint": {
                                  "type": "string"
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "draft",
                                    "testing",
                                    "failed",
                                    "ready",
                                    "active",
                                    "paused"
                                  ]
                                },
                                "enabled": {
                                  "type": "boolean"
                                },
                                "pausedReason": {
                                  "type": "string"
                                },
                                "lastTestRunId": {
                                  "type": "string"
                                },
                                "lastTestPassedAt": {
                                  "type": "string"
                                },
                                "proposal": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "number",
                                          "const": 1
                                        },
                                        "knowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "expectedOutcome": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 2000
                                        },
                                        "requiredAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "targetAutomationId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "baseFingerprint": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "on_change"
                                        },
                                        "kindScopes": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "changeTypes": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "created",
                                                    "updated",
                                                    "deleted"
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "changeTypes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "conditions": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "edge_count"
                                                  },
                                                  "edge": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "gte",
                                                      "eq",
                                                      "lte"
                                                    ]
                                                  },
                                                  "value": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "edge",
                                                  "op",
                                                  "value"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "property"
                                                  },
                                                  "path": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "exists",
                                                      "contains"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "path",
                                                  "op"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "inputTemplate": {
                                          "default": "",
                                          "type": "string",
                                          "maxLength": 4000
                                        },
                                        "cooldownMinutes": {
                                          "default": 15,
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "dailyCap": {
                                          "default": 500,
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCausationDepth": {
                                          "default": 3,
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "knowledgeGraphId",
                                        "agentId",
                                        "name",
                                        "expectedOutcome",
                                        "requiredAccess",
                                        "kind",
                                        "kindScopes",
                                        "conditions",
                                        "inputTemplate",
                                        "cooldownMinutes",
                                        "dailyCap",
                                        "maxCausationDepth"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "number",
                                          "const": 1
                                        },
                                        "knowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "expectedOutcome": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 2000
                                        },
                                        "requiredAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "targetAutomationId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "baseFingerprint": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "on_schedule"
                                        },
                                        "cronExpression": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeZone": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "$ref": "#/$defs/__schema0"
                                          }
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "knowledgeGraphId",
                                        "agentId",
                                        "name",
                                        "expectedOutcome",
                                        "requiredAccess",
                                        "kind",
                                        "cronExpression",
                                        "timeZone",
                                        "input"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "knowledgeGraphId",
                                "agentId",
                                "name",
                                "expectedOutcome",
                                "requiredAccess",
                                "fingerprint",
                                "state",
                                "enabled",
                                "proposal"
                              ],
                              "additionalProperties": false
                            },
                            "prerequisite": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "state": {
                                      "type": "string",
                                      "const": "ready"
                                    }
                                  },
                                  "required": [
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "state": {
                                      "type": "string",
                                      "const": "blocked"
                                    },
                                    "reason": {
                                      "type": "string",
                                      "enum": [
                                        "missing_binding",
                                        "insufficient_access"
                                      ]
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "state",
                                    "reason",
                                    "requiredAccess"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "exactInput": {},
                            "nextScheduledFor": {
                              "type": "string"
                            },
                            "sampleEventId": {
                              "type": "string"
                            },
                            "sampleUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "automation",
                            "prerequisite",
                            "exactInput"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "preview"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/test": {
      "post": {
        "operationId": "Automation_test",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "sampleEventId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        },
                        "preview": {
                          "type": "object",
                          "properties": {
                            "automation": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "knowledge_trigger",
                                    "schedule"
                                  ]
                                },
                                "id": {
                                  "type": "string"
                                },
                                "knowledgeGraphId": {
                                  "type": "string"
                                },
                                "agentId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "expectedOutcome": {
                                  "type": "string"
                                },
                                "requiredAccess": {
                                  "type": "string",
                                  "enum": [
                                    "read_only",
                                    "read_write"
                                  ]
                                },
                                "fingerprint": {
                                  "type": "string"
                                },
                                "state": {
                                  "type": "string",
                                  "enum": [
                                    "draft",
                                    "testing",
                                    "failed",
                                    "ready",
                                    "active",
                                    "paused"
                                  ]
                                },
                                "enabled": {
                                  "type": "boolean"
                                },
                                "pausedReason": {
                                  "type": "string"
                                },
                                "lastTestRunId": {
                                  "type": "string"
                                },
                                "lastTestPassedAt": {
                                  "type": "string"
                                },
                                "proposal": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "number",
                                          "const": 1
                                        },
                                        "knowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "expectedOutcome": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 2000
                                        },
                                        "requiredAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "targetAutomationId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "baseFingerprint": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "on_change"
                                        },
                                        "kindScopes": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "changeTypes": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "created",
                                                    "updated",
                                                    "deleted"
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "changeTypes"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "conditions": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "edge_count"
                                                  },
                                                  "edge": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "gte",
                                                      "eq",
                                                      "lte"
                                                    ]
                                                  },
                                                  "value": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "edge",
                                                  "op",
                                                  "value"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "property"
                                                  },
                                                  "path": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "exists",
                                                      "contains"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "path",
                                                  "op"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "inputTemplate": {
                                          "default": "",
                                          "type": "string",
                                          "maxLength": 4000
                                        },
                                        "cooldownMinutes": {
                                          "default": 15,
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "dailyCap": {
                                          "default": 500,
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCausationDepth": {
                                          "default": 3,
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "knowledgeGraphId",
                                        "agentId",
                                        "name",
                                        "expectedOutcome",
                                        "requiredAccess",
                                        "kind",
                                        "kindScopes",
                                        "conditions",
                                        "inputTemplate",
                                        "cooldownMinutes",
                                        "dailyCap",
                                        "maxCausationDepth"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "number",
                                          "const": 1
                                        },
                                        "knowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "expectedOutcome": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 2000
                                        },
                                        "requiredAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "targetAutomationId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "baseFingerprint": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "on_schedule"
                                        },
                                        "cronExpression": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeZone": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "$ref": "#/$defs/__schema0"
                                          }
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "knowledgeGraphId",
                                        "agentId",
                                        "name",
                                        "expectedOutcome",
                                        "requiredAccess",
                                        "kind",
                                        "cronExpression",
                                        "timeZone",
                                        "input"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "knowledgeGraphId",
                                "agentId",
                                "name",
                                "expectedOutcome",
                                "requiredAccess",
                                "fingerprint",
                                "state",
                                "enabled",
                                "proposal"
                              ],
                              "additionalProperties": false
                            },
                            "prerequisite": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "state": {
                                      "type": "string",
                                      "const": "ready"
                                    }
                                  },
                                  "required": [
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "state": {
                                      "type": "string",
                                      "const": "blocked"
                                    },
                                    "reason": {
                                      "type": "string",
                                      "enum": [
                                        "missing_binding",
                                        "insufficient_access"
                                      ]
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "state",
                                    "reason",
                                    "requiredAccess"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "exactInput": {},
                            "nextScheduledFor": {
                              "type": "string"
                            },
                            "sampleEventId": {
                              "type": "string"
                            },
                            "sampleUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "automation",
                            "prerequisite",
                            "exactInput"
                          ],
                          "additionalProperties": false
                        },
                        "runId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "automation",
                        "preview",
                        "runId"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/test-status": {
      "post": {
        "operationId": "Automation_testStatus",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "automation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/test/cancel": {
      "post": {
        "operationId": "Automation_cancelTest",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "automation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/activate": {
      "post": {
        "operationId": "Automation_activate",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedFingerprint": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "expectedFingerprint"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "automation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/pause": {
      "post": {
        "operationId": "Automation_pause",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "automation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}/resume": {
      "post": {
        "operationId": "Automation_resume",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedFingerprint": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "expectedFingerprint"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "automation": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "knowledge_trigger",
                                "schedule"
                              ]
                            },
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "fingerprint": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "testing",
                                "failed",
                                "ready",
                                "active",
                                "paused"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "proposal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_change"
                                    },
                                    "kindScopes": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "changeTypes": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "updated",
                                                "deleted"
                                              ]
                                            }
                                          }
                                        },
                                        "required": [
                                          "changeTypes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "conditions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "edge_count"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "gte",
                                                  "eq",
                                                  "lte"
                                                ]
                                              },
                                              "value": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "edge",
                                              "op",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "property"
                                              },
                                              "path": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "exists",
                                                  "contains"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "path",
                                              "op"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "inputTemplate": {
                                      "default": "",
                                      "type": "string",
                                      "maxLength": 4000
                                    },
                                    "cooldownMinutes": {
                                      "default": 15,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dailyCap": {
                                      "default": 500,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCausationDepth": {
                                      "default": 3,
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "kindScopes",
                                    "conditions",
                                    "inputTemplate",
                                    "cooldownMinutes",
                                    "dailyCap",
                                    "maxCausationDepth"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "version": {
                                      "type": "number",
                                      "const": 1
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    },
                                    "expectedOutcome": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 2000
                                    },
                                    "requiredAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "targetAutomationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "baseFingerprint": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "kind": {
                                      "type": "string",
                                      "const": "on_schedule"
                                    },
                                    "cronExpression": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeZone": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/$defs/__schema0"
                                      }
                                    }
                                  },
                                  "required": [
                                    "version",
                                    "knowledgeGraphId",
                                    "agentId",
                                    "name",
                                    "expectedOutcome",
                                    "requiredAccess",
                                    "kind",
                                    "cronExpression",
                                    "timeZone",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "expectedOutcome",
                            "requiredAccess",
                            "fingerprint",
                            "state",
                            "enabled",
                            "proposal"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "automation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/automations/brain/{kind}/{id}": {
      "delete": {
        "operationId": "Automation_delete",
        "tags": [
          "Automation"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "knowledge_trigger",
                "schedule"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents": {
      "get": {
        "operationId": "Agent_list",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "true"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "systemPrompt": {
                                "type": "string"
                              },
                              "inputSchema": {
                                "$ref": "#/$defs/__schema0"
                              },
                              "outputSchema": {
                                "$ref": "#/$defs/__schema0"
                              },
                              "modelId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "temperature": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 2
                              },
                              "reasoning": {
                                "type": "string",
                                "enum": [
                                  "off",
                                  "low",
                                  "medium",
                                  "high",
                                  "xhigh",
                                  "max"
                                ]
                              },
                              "modelRoutingPolicy": {
                                "type": "object",
                                "properties": {
                                  "preferredProviderId": {
                                    "type": "string"
                                  },
                                  "credentialId": {
                                    "type": "string"
                                  },
                                  "allowPlatformCredentials": {
                                    "type": "boolean"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "deleted"
                                ]
                              },
                              "humanStartAllowed": {
                                "type": "boolean"
                              },
                              "evalSamplingRate": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "runtimeHint": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "fast_virtual",
                                  "dynamic_worker",
                                  "required_full_os"
                                ]
                              },
                              "workspaceMode": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "persistent"
                                ]
                              },
                              "directToolPolicy": {
                                "type": "object",
                                "properties": {
                                  "workspaceWritePrefixes": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "destructiveCommands": {
                                    "default": "allow",
                                    "type": "string",
                                    "enum": [
                                      "allow",
                                      "deny"
                                    ]
                                  },
                                  "codemode": {
                                    "type": "object",
                                    "properties": {
                                      "enabled": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "minEligibleTools": {
                                        "default": 5,
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 1000
                                      },
                                      "timeoutMs": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "enabled",
                                      "minEligibleTools"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "destructiveCommands"
                                ],
                                "additionalProperties": false
                              },
                              "toolProfileId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "status",
                              "humanStartAllowed",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "agents"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Agent_create",
        "tags": [
          "Agent"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "systemPrompt": {
                    "type": "string",
                    "maxLength": 500000
                  },
                  "modelId": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "reasoning": {
                    "type": "string",
                    "enum": [
                      "off",
                      "low",
                      "medium",
                      "high",
                      "xhigh",
                      "max"
                    ]
                  },
                  "inputSchema": {},
                  "outputSchema": {},
                  "runtimeHint": {
                    "type": "string",
                    "enum": [
                      "none",
                      "fast_virtual",
                      "dynamic_worker",
                      "required_full_os"
                    ]
                  },
                  "workspaceMode": {
                    "type": "string",
                    "enum": [
                      "none",
                      "persistent"
                    ]
                  },
                  "directToolPolicy": {
                    "type": "object",
                    "properties": {
                      "workspaceWritePrefixes": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "destructiveCommands": {
                        "default": "allow",
                        "type": "string",
                        "enum": [
                          "allow",
                          "deny"
                        ]
                      },
                      "codemode": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "default": true,
                            "type": "boolean"
                          },
                          "minEligibleTools": {
                            "default": 5,
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 1000
                          },
                          "timeoutMs": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      }
                    }
                  },
                  "toolProfileId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "humanStartAllowed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}": {
      "get": {
        "operationId": "Agent_get",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "Agent_update",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "systemPrompt": {
                    "type": "string",
                    "maxLength": 500000
                  },
                  "modelId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "temperature": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reasoning": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "off",
                          "low",
                          "medium",
                          "high",
                          "xhigh",
                          "max"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "modelRoutingPolicy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "preferredProviderId": {
                            "type": "string"
                          },
                          "credentialId": {
                            "type": "string"
                          },
                          "allowPlatformCredentials": {
                            "type": "boolean"
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inputSchema": {},
                  "outputSchema": {},
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "deleted"
                    ]
                  },
                  "runtimeHint": {
                    "type": "string",
                    "enum": [
                      "none",
                      "fast_virtual",
                      "dynamic_worker",
                      "required_full_os"
                    ]
                  },
                  "workspaceMode": {
                    "type": "string",
                    "enum": [
                      "none",
                      "persistent"
                    ]
                  },
                  "directToolPolicy": {
                    "type": "object",
                    "properties": {
                      "workspaceWritePrefixes": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "destructiveCommands": {
                        "default": "allow",
                        "type": "string",
                        "enum": [
                          "allow",
                          "deny"
                        ]
                      },
                      "codemode": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "default": true,
                            "type": "boolean"
                          },
                          "minEligibleTools": {
                            "default": 5,
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 1000
                          },
                          "timeoutMs": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      }
                    }
                  },
                  "toolProfileId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "humanStartAllowed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Agent_delete",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/clone": {
      "post": {
        "operationId": "Agent_clone",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/start": {
      "post": {
        "operationId": "Agent_start",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "input": {},
                  "userMessage": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "workspaceOverride": {
                    "type": "string",
                    "enum": [
                      "inherit",
                      "persistent"
                    ]
                  },
                  "conversationId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "closePolicy": {
                    "type": "string",
                    "enum": [
                      "explicit",
                      "auto_on_idle",
                      "auto_on_parent_delivery"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "disposition": {
                          "type": "string",
                          "const": "created"
                        },
                        "run": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "pending"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "active"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "closed"
                                },
                                "output": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "failed"
                                },
                                "failureReason": {
                                  "type": "string"
                                },
                                "failureCategory": {
                                  "type": "string",
                                  "enum": [
                                    "provider_error",
                                    "invariant_violation",
                                    "unhandled_exception",
                                    "dependency_unavailable"
                                  ]
                                },
                                "failureDetail": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "failureReason",
                                "failureCategory"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "abandoned"
                                },
                                "abandonReason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "abandonReason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "workspaceId": {
                              "type": "string"
                            },
                            "branchId": {
                              "type": "string"
                            },
                            "branchName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "workspaceId",
                            "branchId",
                            "branchName"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "disposition",
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/skills": {
      "get": {
        "operationId": "Agent_listSkills",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "skills": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skill": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "name",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "hasActiveVersion": {
                                "type": "boolean"
                              },
                              "activeVersion": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "versionNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "filesUrl": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "draft",
                                      "active",
                                      "superseded"
                                    ]
                                  },
                                  "createdBy": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "body": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "license": {
                                    "type": "string"
                                  },
                                  "compatibility": {
                                    "type": "string"
                                  },
                                  "skillMetadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "versionNumber",
                                  "contentHash",
                                  "filesUrl",
                                  "status",
                                  "allowedTools",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "policy": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "always"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "never"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "require_approval"
                                      },
                                      "approverPrompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "max_calls_per_run"
                                      },
                                      "limit": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "limit"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "skill",
                              "hasActiveVersion",
                              "policy"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "skills"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/skills/{skillId}": {
      "post": {
        "operationId": "Agent_linkSkill",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "policy": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "always"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "never"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "require_approval"
                          },
                          "approverPrompt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "max_calls_per_run"
                          },
                          "limit": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "type",
                          "limit"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "link": {
                          "type": "object",
                          "properties": {
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "skillId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "policy": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "always"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "never"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "require_approval"
                                    },
                                    "approverPrompt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "max_calls_per_run"
                                    },
                                    "limit": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "limit"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "agentId",
                            "skillId",
                            "policy"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "link"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Agent_unlinkSkill",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "unlinked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unlinked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/skills/{skillId}/policy": {
      "put": {
        "operationId": "Agent_updateSkillPolicy",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "policy": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "always"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "never"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "require_approval"
                          },
                          "approverPrompt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "max_calls_per_run"
                          },
                          "limit": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "type",
                          "limit"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "policy"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "updated"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/artifacts": {
      "get": {
        "operationId": "Agent_listArtifacts",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "linkedArtifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "nameSlug": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "producedByRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "activeVersion": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "versionNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "contentKey": {
                                    "type": "string"
                                  },
                                  "filename": {
                                    "type": "string"
                                  },
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "sizeBytes": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "isActive": {
                                    "type": "boolean"
                                  },
                                  "source": {
                                    "type": "string",
                                    "enum": [
                                      "upload",
                                      "template_clone",
                                      "sync",
                                      "changeset_adopt",
                                      "changeset_revert"
                                    ]
                                  },
                                  "externalRevisionId": {
                                    "type": "string"
                                  },
                                  "createdBy": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "versionNumber",
                                  "contentHash",
                                  "contentKey",
                                  "mimeType",
                                  "isActive",
                                  "source",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "pinnedVersionId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "linkedArtifacts"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/artifacts/{artifactId}": {
      "post": {
        "operationId": "Agent_linkArtifact",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "link": {
                          "type": "object",
                          "properties": {
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "artifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "activeVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "origin": {
                              "type": "string",
                              "enum": [
                                "prompt",
                                "manual"
                              ]
                            }
                          },
                          "required": [
                            "agentId",
                            "artifactId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "link"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Agent_unlinkArtifact",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "unlinked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unlinked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/artifacts/{artifactId}/version": {
      "put": {
        "operationId": "Agent_setArtifactVersion",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "versionId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "link": {
                          "type": "object",
                          "properties": {
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "artifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "activeVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "origin": {
                              "type": "string",
                              "enum": [
                                "prompt",
                                "manual"
                              ]
                            }
                          },
                          "required": [
                            "agentId",
                            "artifactId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "link"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/prompt-versions": {
      "get": {
        "operationId": "Agent_listPromptVersions",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "versionNumber": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "contentHash": {
                                "type": "string",
                                "minLength": 1
                              },
                              "content": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "versionNumber",
                              "contentHash",
                              "content",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "versions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/corpora": {
      "get": {
        "operationId": "Agent_listCorpora",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "corpora": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "slug",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "corpora"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Agent_attachCorpus",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "corpusId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "retrievalPolicy": {
                    "type": "object",
                    "properties": {
                      "allowedModes": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "semantic",
                            "keyword",
                            "citation"
                          ]
                        }
                      },
                      "maxChunks": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxAgeSeconds": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  }
                },
                "required": [
                  "corpusId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "attached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "attached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/quality": {
      "get": {
        "operationId": "Agent_quality",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "quality": {
                          "type": "object",
                          "properties": {
                            "aggregate": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "runScores": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string"
                                  },
                                  "score": {
                                    "anyOf": [
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "dimensionScores": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "number"
                                    }
                                  },
                                  "reasoning": {
                                    "type": "string"
                                  },
                                  "humanFeedback": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "score",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "scoredRunCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "aggregate",
                            "runScores",
                            "scoredRunCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "quality"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/corpora/{corpusId}": {
      "delete": {
        "operationId": "Agent_detachCorpus",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "corpusId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "detached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "detached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/knowledge-graphs": {
      "get": {
        "operationId": "Agent_listKnowledgeGraphs",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraphs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "schemaSlug": {
                                "type": "string"
                              },
                              "corpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "corpusSlug": {
                                "type": "string"
                              },
                              "origin": {
                                "default": "seeded",
                                "type": "string",
                                "enum": [
                                  "seeded",
                                  "empty",
                                  "empty_with_schema"
                                ]
                              },
                              "sourceCorpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceCorpusSlug": {
                                "type": "string"
                              },
                              "parentKnowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "parentKnowledgeGraphName": {
                                "type": "string"
                              },
                              "directChildCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "brainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "key": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "subject": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "externalId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "label": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "label"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "purpose": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "parentBrainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "generation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "lifecycle": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "held",
                                      "archived",
                                      "deleting",
                                      "deleted"
                                    ]
                                  }
                                },
                                "required": [
                                  "brainId",
                                  "key",
                                  "name",
                                  "subject",
                                  "purpose",
                                  "generation",
                                  "lifecycle"
                                ],
                                "additionalProperties": false
                              },
                              "description": {
                                "type": "string"
                              },
                              "lifecycleState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "inducing",
                                  "ready",
                                  "stale",
                                  "errored"
                                ]
                              },
                              "policy": {
                                "type": "object",
                                "properties": {
                                  "refresh": {
                                    "default": "manual",
                                    "type": "string",
                                    "enum": [
                                      "manual",
                                      "on_corpus_change",
                                      "scheduled"
                                    ]
                                  },
                                  "structuring": {
                                    "type": "string",
                                    "enum": [
                                      "manual",
                                      "on_source_change"
                                    ]
                                  },
                                  "refreshCron": {
                                    "type": "string"
                                  },
                                  "inductionBudgetCents": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "refresh"
                                ],
                                "additionalProperties": false
                              },
                              "writePolicy": {
                                "type": "string",
                                "enum": [
                                  "direct",
                                  "propose"
                                ]
                              },
                              "availabilityState": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "held",
                                  "deleted"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "latestVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "versionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "nodeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "edgeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingChangeSetCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "lastActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "connectionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "activeConnectionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "connectionHealth": {
                                "type": "string",
                                "enum": [
                                  "never_connected",
                                  "healthy",
                                  "degraded"
                                ]
                              },
                              "lastConnectionActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "schemaSlug",
                              "corpusId",
                              "origin",
                              "name",
                              "identity",
                              "lifecycleState",
                              "policy",
                              "writePolicy",
                              "availabilityState",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "bindings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "queryMode": {
                                "type": "string",
                                "enum": [
                                  "read_only",
                                  "read_write"
                                ]
                              },
                              "maintenanceInstructions": {
                                "type": "string"
                              },
                              "lastWriteAt": {
                                "type": "string"
                              },
                              "writesLast7d": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "queryMode"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "knowledgeGraphs",
                        "bindings"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Agent_attachKnowledgeGraph",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "queryMode": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  },
                  "allowedKinds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "maintenanceInstructions": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "knowledgeGraphId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "attached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "attached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/knowledge-graphs/{kgId}": {
      "delete": {
        "operationId": "Agent_detachKnowledgeGraph",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "detached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "detached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/invocations": {
      "get": {
        "operationId": "Agent_listInvocations",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "invocations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "targetAgent": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "systemPrompt": {
                                    "type": "string"
                                  },
                                  "inputSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  },
                                  "outputSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  },
                                  "modelId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "temperature": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 2
                                  },
                                  "reasoning": {
                                    "type": "string",
                                    "enum": [
                                      "off",
                                      "low",
                                      "medium",
                                      "high",
                                      "xhigh",
                                      "max"
                                    ]
                                  },
                                  "modelRoutingPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "preferredProviderId": {
                                        "type": "string"
                                      },
                                      "credentialId": {
                                        "type": "string"
                                      },
                                      "allowPlatformCredentials": {
                                        "type": "boolean"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "paused",
                                      "deleted"
                                    ]
                                  },
                                  "humanStartAllowed": {
                                    "type": "boolean"
                                  },
                                  "evalSamplingRate": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 100
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "toolProfileId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "name",
                                  "status",
                                  "humanStartAllowed",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "binding": {
                                "type": "object",
                                "properties": {
                                  "alias": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 80
                                  },
                                  "description": {
                                    "type": "string",
                                    "maxLength": 1000
                                  },
                                  "defaultWaitPolicy": {
                                    "default": "wait_for_result",
                                    "type": "string",
                                    "enum": [
                                      "wait_for_result",
                                      "fire_and_forget"
                                    ]
                                  },
                                  "timeoutMs": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "maxConcurrentRuns": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "alias",
                                  "defaultWaitPolicy"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "targetAgent",
                              "binding"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "invocations"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Agent_attachInvocation",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "defaultWaitPolicy": {
                    "default": "wait_for_result",
                    "type": "string",
                    "enum": [
                      "wait_for_result",
                      "fire_and_forget"
                    ]
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxConcurrentRuns": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "targetAgentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "alias",
                  "targetAgentId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "targetAgent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "binding": {
                          "type": "object",
                          "properties": {
                            "alias": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 1000
                            },
                            "defaultWaitPolicy": {
                              "default": "wait_for_result",
                              "type": "string",
                              "enum": [
                                "wait_for_result",
                                "fire_and_forget"
                              ]
                            },
                            "timeoutMs": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "maxConcurrentRuns": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "alias",
                            "defaultWaitPolicy"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "targetAgent",
                        "binding"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/invocations/{targetAgentId}": {
      "delete": {
        "operationId": "Agent_detachInvocation",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "targetAgentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "detached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "detached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/improve": {
      "post": {
        "operationId": "Agent_improve",
        "tags": [
          "Agent"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/apps": {
      "get": {
        "operationId": "App_list",
        "tags": [
          "App"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "apps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "app": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "runtimeClass": {
                                    "type": "string",
                                    "enum": [
                                      "facet_app",
                                      "mcp_endpoint"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "deploying",
                                      "active",
                                      "degraded",
                                      "stopped",
                                      "failed"
                                    ]
                                  },
                                  "mcpBinding": {
                                    "type": "object",
                                    "properties": {
                                      "corpusId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "mode": {
                                        "default": "read_only",
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "oauthAudience": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "corpusId",
                                      "mode",
                                      "oauthAudience"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceCheckpointId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "activeDeploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "primaryRouteId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "supervisorName": {
                                    "type": "string"
                                  },
                                  "createdByUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "createdByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "lastHealthAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "lastRequestAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "name",
                                  "slug",
                                  "runtimeClass",
                                  "status",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "activeDeployment": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "deploying",
                                      "active",
                                      "failed",
                                      "superseded",
                                      "stopped"
                                    ]
                                  },
                                  "bundleManifest": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "static_site_bundle"
                                      },
                                      "entrypoint": {
                                        "default": "/index.html",
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spaFallback": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "files": {
                                        "minItems": 1,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentType": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "content": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "contentType",
                                            "content"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entrypoint",
                                      "spaFallback",
                                      "files"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "codeId": {
                                    "type": "string"
                                  },
                                  "sourceRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceCheckpointId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "deployedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "status",
                                  "bundleManifest",
                                  "codeId",
                                  "sourceRunId",
                                  "sourceWorkspaceCheckpointId",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "primaryRoute": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "routeKind": {
                                    "type": "string",
                                    "enum": [
                                      "worker_path",
                                      "mcp"
                                    ]
                                  },
                                  "pathPrefix": {
                                    "type": "string"
                                  },
                                  "externalUrl": {
                                    "type": "string"
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "routeKind",
                                  "pathPrefix",
                                  "externalUrl",
                                  "isPrimary",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "latestEvent": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "promotion_requested",
                                      "deployment_started",
                                      "deployment_succeeded",
                                      "deployment_failed",
                                      "status_changed",
                                      "health_checked"
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "payload": {},
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "type",
                                  "message",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              },
                              "liveStatus": {
                                "type": "object",
                                "properties": {
                                  "ok": {
                                    "type": "boolean",
                                    "const": true
                                  },
                                  "appInstanceId": {
                                    "type": "string"
                                  },
                                  "deploymentId": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "stopped"
                                    ]
                                  },
                                  "requestCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastRequestAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ok",
                                  "status",
                                  "requestCount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "app"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "apps"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/apps/promote": {
      "post": {
        "operationId": "App_promote",
        "tags": [
          "App"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "sourceWorkspaceCheckpointId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sourceArtifactIds": {
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "runId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "app": {
                          "type": "object",
                          "properties": {
                            "app": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "runtimeClass": {
                                  "type": "string",
                                  "enum": [
                                    "facet_app",
                                    "mcp_endpoint"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "degraded",
                                    "stopped",
                                    "failed"
                                  ]
                                },
                                "mcpBinding": {
                                  "type": "object",
                                  "properties": {
                                    "corpusId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "mode": {
                                      "default": "read_only",
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "oauthAudience": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "corpusId",
                                    "mode",
                                    "oauthAudience"
                                  ],
                                  "additionalProperties": false
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "activeDeploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "primaryRouteId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "supervisorName": {
                                  "type": "string"
                                },
                                "createdByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "createdByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "lastHealthAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "lastRequestAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "slug",
                                "runtimeClass",
                                "status",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "activeDeployment": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "failed",
                                    "superseded",
                                    "stopped"
                                  ]
                                },
                                "bundleManifest": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "static_site_bundle"
                                    },
                                    "entrypoint": {
                                      "default": "/index.html",
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spaFallback": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "files": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "path": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentType": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "content": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "path",
                                          "contentType",
                                          "content"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "entrypoint",
                                    "spaFallback",
                                    "files"
                                  ],
                                  "additionalProperties": false
                                },
                                "codeId": {
                                  "type": "string"
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "error": {
                                  "type": "string"
                                },
                                "deployedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "status",
                                "bundleManifest",
                                "codeId",
                                "sourceRunId",
                                "sourceWorkspaceCheckpointId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "primaryRoute": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "routeKind": {
                                  "type": "string",
                                  "enum": [
                                    "worker_path",
                                    "mcp"
                                  ]
                                },
                                "pathPrefix": {
                                  "type": "string"
                                },
                                "externalUrl": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "routeKind",
                                "pathPrefix",
                                "externalUrl",
                                "isPrimary",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "latestEvent": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "promotion_requested",
                                    "deployment_started",
                                    "deployment_succeeded",
                                    "deployment_failed",
                                    "status_changed",
                                    "health_checked"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "payload": {},
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "type",
                                "message",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "liveStatus": {
                              "type": "object",
                              "properties": {
                                "ok": {
                                  "type": "boolean",
                                  "const": true
                                },
                                "appInstanceId": {
                                  "type": "string"
                                },
                                "deploymentId": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "stopped"
                                  ]
                                },
                                "requestCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastRequestAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "ok",
                                "status",
                                "requestCount"
                              ],
                              "additionalProperties": false
                            },
                            "deployments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "deploying",
                                      "active",
                                      "failed",
                                      "superseded",
                                      "stopped"
                                    ]
                                  },
                                  "bundleManifest": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "static_site_bundle"
                                      },
                                      "entrypoint": {
                                        "default": "/index.html",
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spaFallback": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "files": {
                                        "minItems": 1,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentType": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "content": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "contentType",
                                            "content"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entrypoint",
                                      "spaFallback",
                                      "files"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "codeId": {
                                    "type": "string"
                                  },
                                  "sourceRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceCheckpointId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "deployedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "status",
                                  "bundleManifest",
                                  "codeId",
                                  "sourceRunId",
                                  "sourceWorkspaceCheckpointId",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "routes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "routeKind": {
                                    "type": "string",
                                    "enum": [
                                      "worker_path",
                                      "mcp"
                                    ]
                                  },
                                  "pathPrefix": {
                                    "type": "string"
                                  },
                                  "externalUrl": {
                                    "type": "string"
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "routeKind",
                                  "pathPrefix",
                                  "externalUrl",
                                  "isPrimary",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "promotion_requested",
                                      "deployment_started",
                                      "deployment_succeeded",
                                      "deployment_failed",
                                      "status_changed",
                                      "health_checked"
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "payload": {},
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "type",
                                  "message",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "app",
                            "deployments",
                            "routes",
                            "events"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "app"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/apps/corpus-mcp": {
      "post": {
        "operationId": "App_createCorpusMcp",
        "tags": [
          "App"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "corpusId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  }
                },
                "required": [
                  "corpusId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "app": {
                          "type": "object",
                          "properties": {
                            "app": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "runtimeClass": {
                                  "type": "string",
                                  "enum": [
                                    "facet_app",
                                    "mcp_endpoint"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "degraded",
                                    "stopped",
                                    "failed"
                                  ]
                                },
                                "mcpBinding": {
                                  "type": "object",
                                  "properties": {
                                    "corpusId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "mode": {
                                      "default": "read_only",
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "oauthAudience": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "corpusId",
                                    "mode",
                                    "oauthAudience"
                                  ],
                                  "additionalProperties": false
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "activeDeploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "primaryRouteId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "supervisorName": {
                                  "type": "string"
                                },
                                "createdByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "createdByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "lastHealthAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "lastRequestAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "slug",
                                "runtimeClass",
                                "status",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "activeDeployment": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "failed",
                                    "superseded",
                                    "stopped"
                                  ]
                                },
                                "bundleManifest": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "static_site_bundle"
                                    },
                                    "entrypoint": {
                                      "default": "/index.html",
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spaFallback": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "files": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "path": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentType": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "content": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "path",
                                          "contentType",
                                          "content"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "entrypoint",
                                    "spaFallback",
                                    "files"
                                  ],
                                  "additionalProperties": false
                                },
                                "codeId": {
                                  "type": "string"
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "error": {
                                  "type": "string"
                                },
                                "deployedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "status",
                                "bundleManifest",
                                "codeId",
                                "sourceRunId",
                                "sourceWorkspaceCheckpointId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "primaryRoute": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "routeKind": {
                                  "type": "string",
                                  "enum": [
                                    "worker_path",
                                    "mcp"
                                  ]
                                },
                                "pathPrefix": {
                                  "type": "string"
                                },
                                "externalUrl": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "routeKind",
                                "pathPrefix",
                                "externalUrl",
                                "isPrimary",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "latestEvent": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "promotion_requested",
                                    "deployment_started",
                                    "deployment_succeeded",
                                    "deployment_failed",
                                    "status_changed",
                                    "health_checked"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "payload": {},
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "type",
                                "message",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "liveStatus": {
                              "type": "object",
                              "properties": {
                                "ok": {
                                  "type": "boolean",
                                  "const": true
                                },
                                "appInstanceId": {
                                  "type": "string"
                                },
                                "deploymentId": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "stopped"
                                  ]
                                },
                                "requestCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastRequestAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "ok",
                                "status",
                                "requestCount"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "app"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "app"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/apps/{appId}": {
      "get": {
        "operationId": "App_get",
        "tags": [
          "App"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "app": {
                          "type": "object",
                          "properties": {
                            "app": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "runtimeClass": {
                                  "type": "string",
                                  "enum": [
                                    "facet_app",
                                    "mcp_endpoint"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "degraded",
                                    "stopped",
                                    "failed"
                                  ]
                                },
                                "mcpBinding": {
                                  "type": "object",
                                  "properties": {
                                    "corpusId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "mode": {
                                      "default": "read_only",
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "oauthAudience": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "corpusId",
                                    "mode",
                                    "oauthAudience"
                                  ],
                                  "additionalProperties": false
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "activeDeploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "primaryRouteId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "supervisorName": {
                                  "type": "string"
                                },
                                "createdByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "createdByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "lastHealthAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "lastRequestAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "slug",
                                "runtimeClass",
                                "status",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "activeDeployment": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "failed",
                                    "superseded",
                                    "stopped"
                                  ]
                                },
                                "bundleManifest": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "static_site_bundle"
                                    },
                                    "entrypoint": {
                                      "default": "/index.html",
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spaFallback": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "files": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "path": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentType": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "content": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "path",
                                          "contentType",
                                          "content"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "entrypoint",
                                    "spaFallback",
                                    "files"
                                  ],
                                  "additionalProperties": false
                                },
                                "codeId": {
                                  "type": "string"
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "error": {
                                  "type": "string"
                                },
                                "deployedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "status",
                                "bundleManifest",
                                "codeId",
                                "sourceRunId",
                                "sourceWorkspaceCheckpointId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "primaryRoute": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "routeKind": {
                                  "type": "string",
                                  "enum": [
                                    "worker_path",
                                    "mcp"
                                  ]
                                },
                                "pathPrefix": {
                                  "type": "string"
                                },
                                "externalUrl": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "routeKind",
                                "pathPrefix",
                                "externalUrl",
                                "isPrimary",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "latestEvent": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "promotion_requested",
                                    "deployment_started",
                                    "deployment_succeeded",
                                    "deployment_failed",
                                    "status_changed",
                                    "health_checked"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "payload": {},
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "type",
                                "message",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "liveStatus": {
                              "type": "object",
                              "properties": {
                                "ok": {
                                  "type": "boolean",
                                  "const": true
                                },
                                "appInstanceId": {
                                  "type": "string"
                                },
                                "deploymentId": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "stopped"
                                  ]
                                },
                                "requestCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastRequestAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "ok",
                                "status",
                                "requestCount"
                              ],
                              "additionalProperties": false
                            },
                            "deployments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "deploying",
                                      "active",
                                      "failed",
                                      "superseded",
                                      "stopped"
                                    ]
                                  },
                                  "bundleManifest": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "static_site_bundle"
                                      },
                                      "entrypoint": {
                                        "default": "/index.html",
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spaFallback": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "files": {
                                        "minItems": 1,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentType": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "content": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "contentType",
                                            "content"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entrypoint",
                                      "spaFallback",
                                      "files"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "codeId": {
                                    "type": "string"
                                  },
                                  "sourceRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceCheckpointId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "deployedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "status",
                                  "bundleManifest",
                                  "codeId",
                                  "sourceRunId",
                                  "sourceWorkspaceCheckpointId",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "routes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "routeKind": {
                                    "type": "string",
                                    "enum": [
                                      "worker_path",
                                      "mcp"
                                    ]
                                  },
                                  "pathPrefix": {
                                    "type": "string"
                                  },
                                  "externalUrl": {
                                    "type": "string"
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "routeKind",
                                  "pathPrefix",
                                  "externalUrl",
                                  "isPrimary",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "promotion_requested",
                                      "deployment_started",
                                      "deployment_succeeded",
                                      "deployment_failed",
                                      "status_changed",
                                      "health_checked"
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "payload": {},
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "type",
                                  "message",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "app",
                            "deployments",
                            "routes",
                            "events"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "app"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/apps/{appId}/lifecycle": {
      "post": {
        "operationId": "App_lifecycle",
        "tags": [
          "App"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "stopped"
                    ]
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "app": {
                          "type": "object",
                          "properties": {
                            "app": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "name": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "runtimeClass": {
                                  "type": "string",
                                  "enum": [
                                    "facet_app",
                                    "mcp_endpoint"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "degraded",
                                    "stopped",
                                    "failed"
                                  ]
                                },
                                "mcpBinding": {
                                  "type": "object",
                                  "properties": {
                                    "corpusId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "mode": {
                                      "default": "read_only",
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "oauthAudience": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "corpusId",
                                    "mode",
                                    "oauthAudience"
                                  ],
                                  "additionalProperties": false
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "activeDeploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "primaryRouteId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "supervisorName": {
                                  "type": "string"
                                },
                                "createdByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "createdByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "lastHealthAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "lastRequestAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "name",
                                "slug",
                                "runtimeClass",
                                "status",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "activeDeployment": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "deploying",
                                    "active",
                                    "failed",
                                    "superseded",
                                    "stopped"
                                  ]
                                },
                                "bundleManifest": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "static_site_bundle"
                                    },
                                    "entrypoint": {
                                      "default": "/index.html",
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spaFallback": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "files": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "path": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentType": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "content": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "path",
                                          "contentType",
                                          "content"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "entrypoint",
                                    "spaFallback",
                                    "files"
                                  ],
                                  "additionalProperties": false
                                },
                                "codeId": {
                                  "type": "string"
                                },
                                "sourceRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceWorkspaceCheckpointId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceArtifactIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "error": {
                                  "type": "string"
                                },
                                "deployedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "status",
                                "bundleManifest",
                                "codeId",
                                "sourceRunId",
                                "sourceWorkspaceCheckpointId",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "primaryRoute": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "routeKind": {
                                  "type": "string",
                                  "enum": [
                                    "worker_path",
                                    "mcp"
                                  ]
                                },
                                "pathPrefix": {
                                  "type": "string"
                                },
                                "externalUrl": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "routeKind",
                                "pathPrefix",
                                "externalUrl",
                                "isPrimary",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "latestEvent": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "appInstanceId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "deploymentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "promotion_requested",
                                    "deployment_started",
                                    "deployment_succeeded",
                                    "deployment_failed",
                                    "status_changed",
                                    "health_checked"
                                  ]
                                },
                                "message": {
                                  "type": "string"
                                },
                                "payload": {},
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "appInstanceId",
                                "type",
                                "message",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "liveStatus": {
                              "type": "object",
                              "properties": {
                                "ok": {
                                  "type": "boolean",
                                  "const": true
                                },
                                "appInstanceId": {
                                  "type": "string"
                                },
                                "deploymentId": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "stopped"
                                  ]
                                },
                                "requestCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastRequestAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "ok",
                                "status",
                                "requestCount"
                              ],
                              "additionalProperties": false
                            },
                            "deployments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "deploying",
                                      "active",
                                      "failed",
                                      "superseded",
                                      "stopped"
                                    ]
                                  },
                                  "bundleManifest": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "static_site_bundle"
                                      },
                                      "entrypoint": {
                                        "default": "/index.html",
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spaFallback": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "files": {
                                        "minItems": 1,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentType": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "content": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "contentType",
                                            "content"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entrypoint",
                                      "spaFallback",
                                      "files"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "codeId": {
                                    "type": "string"
                                  },
                                  "sourceRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceWorkspaceCheckpointId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "deployedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "status",
                                  "bundleManifest",
                                  "codeId",
                                  "sourceRunId",
                                  "sourceWorkspaceCheckpointId",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "routes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "routeKind": {
                                    "type": "string",
                                    "enum": [
                                      "worker_path",
                                      "mcp"
                                    ]
                                  },
                                  "pathPrefix": {
                                    "type": "string"
                                  },
                                  "externalUrl": {
                                    "type": "string"
                                  },
                                  "isPrimary": {
                                    "type": "boolean"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "routeKind",
                                  "pathPrefix",
                                  "externalUrl",
                                  "isPrimary",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "appInstanceId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "deploymentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "promotion_requested",
                                      "deployment_started",
                                      "deployment_succeeded",
                                      "deployment_failed",
                                      "status_changed",
                                      "health_checked"
                                    ]
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "payload": {},
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "appInstanceId",
                                  "type",
                                  "message",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "app",
                            "deployments",
                            "routes",
                            "events"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "app"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-folders": {
      "get": {
        "operationId": "ArtifactFolder_list",
        "tags": [
          "ArtifactFolder"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "folders": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64,
                                "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 255
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "parentId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "tenantId",
                              "slug",
                              "name",
                              "id",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "folders"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "ArtifactFolder_create",
        "tags": [
          "ArtifactFolder"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "parentFolderId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "slug",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "folder": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "slug",
                            "name",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "folder"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-folders/{slug}": {
      "get": {
        "operationId": "ArtifactFolder_get",
        "tags": [
          "ArtifactFolder"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "folder": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "slug",
                            "name",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "path": {
                          "type": "string"
                        },
                        "childFolders": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "folder"
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "segment": {
                                "type": "string"
                              },
                              "position": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "segment",
                              "position"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "artifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "artifact"
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "segment": {
                                "type": "string"
                              },
                              "position": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "segment",
                              "position"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "folder",
                        "path",
                        "childFolders",
                        "artifacts"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "ArtifactFolder_rename",
        "tags": [
          "ArtifactFolder"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "folder": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "slug",
                            "name",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "folder"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "ArtifactFolder_delete",
        "tags": [
          "ArtifactFolder"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-folders/{slug}/move": {
      "post": {
        "operationId": "ArtifactFolder_move",
        "tags": [
          "ArtifactFolder"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "parentFolderId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "parentFolderId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "moved": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "moved"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-folders/artifacts/{artifactId}/folder": {
      "put": {
        "operationId": "ArtifactFolder_placeArtifact",
        "tags": [
          "ArtifactFolder"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "folderId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "folderId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "placed": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "placed"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources": {
      "get": {
        "operationId": "ArtifactSource_list",
        "tags": [
          "ArtifactSource"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "provider": {
                                "type": "string",
                                "enum": [
                                  "google_docs",
                                  "notion",
                                  "confluence",
                                  "url"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "error",
                                  "pending_auth"
                                ]
                              },
                              "lastSyncAt": {
                                "type": "string"
                              },
                              "lastSyncError": {
                                "type": "string"
                              },
                              "scope": {
                                "type": "string",
                                "enum": [
                                  "org",
                                  "user"
                                ]
                              },
                              "syncIntervalMs": {
                                "type": "number"
                              },
                              "accountEmail": {
                                "type": "string"
                              },
                              "artifactCount": {
                                "type": "number"
                              },
                              "canPromote": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "provider",
                              "name",
                              "status",
                              "scope"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "providers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "provider": {
                                "type": "string",
                                "enum": [
                                  "google_docs",
                                  "notion",
                                  "confluence",
                                  "url"
                                ]
                              },
                              "accountCount": {
                                "type": "number"
                              },
                              "totalArtifactCount": {
                                "type": "number"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "error",
                                  "pending_auth"
                                ]
                              },
                              "affectedCount": {
                                "type": "number"
                              },
                              "latestSyncAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "provider",
                              "accountCount",
                              "totalArtifactCount",
                              "status",
                              "affectedCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "localCount": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "sources",
                        "providers",
                        "localCount"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "ArtifactSource_create",
        "tags": [
          "ArtifactSource"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "google_docs",
                      "notion",
                      "confluence",
                      "url"
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "org",
                      "user"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "config": {},
                  "syncIntervalMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "connectorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "bundle": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "mcp_server",
                          "http_endpoint",
                          "webhook_outbound"
                        ]
                      },
                      "displayName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "endpointConfig": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "mcp_server"
                              },
                              "transport": {
                                "type": "string",
                                "enum": [
                                  "streamable_http"
                                ]
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "serverSlug": {
                                "type": "string",
                                "minLength": 1
                              },
                              "defaultHeaders": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              },
                              "apiKeyHeaderName": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "kind",
                              "url",
                              "serverSlug"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "http_endpoint"
                              },
                              "baseUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "defaultHeaders": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              },
                              "tools": {
                                "default": [],
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "method": {
                                      "default": "POST",
                                      "type": "string",
                                      "enum": [
                                        "GET",
                                        "POST",
                                        "PUT",
                                        "PATCH",
                                        "DELETE"
                                      ]
                                    },
                                    "path": {
                                      "type": "string"
                                    },
                                    "inputSchema": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "name",
                                    "path",
                                    "inputSchema"
                                  ]
                                }
                              },
                              "auth": {
                                "type": "object",
                                "properties": {
                                  "in": {
                                    "type": "string",
                                    "enum": [
                                      "header",
                                      "query"
                                    ]
                                  },
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "scheme": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "in",
                                  "name"
                                ]
                              },
                              "oauth2": {
                                "type": "object",
                                "properties": {
                                  "tokenUrl": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "scopes": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "tokenUrl"
                                ]
                              },
                              "hmac": {
                                "type": "object",
                                "properties": {
                                  "algorithm": {
                                    "default": "sha256",
                                    "type": "string",
                                    "enum": [
                                      "sha256",
                                      "sha512"
                                    ]
                                  },
                                  "encoding": {
                                    "default": "hex",
                                    "type": "string",
                                    "enum": [
                                      "hex",
                                      "base64"
                                    ]
                                  },
                                  "signatureHeader": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signedComponents": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "timestamp",
                                        "method",
                                        "path",
                                        "query",
                                        "body"
                                      ]
                                    }
                                  },
                                  "separator": {
                                    "type": "string"
                                  },
                                  "timestampHeader": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signaturePrefix": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "signatureHeader",
                                  "signedComponents"
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "baseUrl"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "webhook_outbound"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "signingSecretRef": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "url"
                            ]
                          }
                        ]
                      },
                      "basePolicy": {
                        "type": "object",
                        "properties": {
                          "trustBoundary": {
                            "type": "string",
                            "enum": [
                              "local",
                              "tenant_private",
                              "external_remote"
                            ]
                          },
                          "allowedAgentIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "allowedToolNames": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "rateLimitPerMinute": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "budgetCents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "displayName",
                      "endpointConfig"
                    ]
                  }
                },
                "required": [
                  "provider",
                  "scope",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}": {
      "get": {
        "operationId": "ArtifactSource_get",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "ArtifactSource_update",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "syncIntervalMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "ArtifactSource_delete",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/pause": {
      "post": {
        "operationId": "ArtifactSource_pause",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/resume": {
      "post": {
        "operationId": "ArtifactSource_resume",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/promote-scope": {
      "post": {
        "operationId": "ArtifactSource_promoteScope",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "provider": {
                              "type": "string",
                              "enum": [
                                "google_docs",
                                "notion",
                                "confluence",
                                "url"
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "error",
                                "pending_auth"
                              ]
                            },
                            "lastSyncAt": {
                              "type": "string"
                            },
                            "lastSyncError": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "enum": [
                                "org",
                                "user"
                              ]
                            },
                            "syncIntervalMs": {
                              "type": "number"
                            },
                            "accountEmail": {
                              "type": "string"
                            },
                            "artifactCount": {
                              "type": "number"
                            },
                            "canPromote": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "provider",
                            "name",
                            "status",
                            "scope"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/mappings": {
      "get": {
        "operationId": "ArtifactSource_listMappings",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "mappings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sourceId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "artifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "externalId": {
                                "type": "string"
                              },
                              "externalUrl": {
                                "type": "string"
                              },
                              "externalRevisionId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "sourceId",
                              "artifactId",
                              "externalId"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "mappings"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "ArtifactSource_createMapping",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "artifactId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "externalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "externalUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "artifactId",
                  "externalId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "mapping": {
                          "type": "object",
                          "properties": {
                            "sourceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "artifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "externalId": {
                              "type": "string"
                            },
                            "externalUrl": {
                              "type": "string"
                            },
                            "externalRevisionId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "sourceId",
                            "artifactId",
                            "externalId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "mapping"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/mappings/{artifactId}": {
      "delete": {
        "operationId": "ArtifactSource_removeMapping",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "removed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "removed"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/sync": {
      "post": {
        "operationId": "ArtifactSource_sync",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "enqueued": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "enqueued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/documents": {
      "get": {
        "operationId": "ArtifactSource_listDocuments",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "documents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "externalId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "externalUrl": {
                                "type": "string"
                              },
                              "modifiedAt": {
                                "type": "string"
                              },
                              "folderPath": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "filename": {
                                "type": "string"
                              },
                              "alreadyMapped": {
                                "type": "boolean"
                              },
                              "mappedArtifactId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "externalId",
                              "name",
                              "mimeType",
                              "alreadyMapped"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "documents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/picker-token": {
      "get": {
        "operationId": "ArtifactSource_pickerToken",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string"
                        },
                        "apiKey": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "accessToken",
                        "apiKey"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifact-sources/{sourceId}/connect": {
      "post": {
        "operationId": "ArtifactSource_connect",
        "tags": [
          "ArtifactSource"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "authUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "authUrl"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts": {
      "get": {
        "operationId": "Artifact_list",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "google_docs",
                "notion",
                "confluence",
                "url"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "uploads",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "artifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "nameSlug": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "producedByRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "linkedAgentCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "source": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "provider": {
                                    "type": "string",
                                    "enum": [
                                      "google_docs",
                                      "notion",
                                      "confluence",
                                      "url"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "paused",
                                      "error",
                                      "pending_auth"
                                    ]
                                  },
                                  "lastSyncAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "accountEmail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "provider",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "createdAt",
                              "updatedAt",
                              "linkedAgentCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "artifacts"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Artifact_create",
        "tags": [
          "Artifact"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "producedByRunId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "artifact": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "nameSlug": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "producedByRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "artifact"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/facets": {
      "get": {
        "operationId": "Artifact_facets",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "sourceId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "google_docs",
                "notion",
                "confluence",
                "url"
              ]
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "uploads",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "facets": {
                          "type": "object",
                          "properties": {
                            "sources": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "types": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "corpora": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "total": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "sources",
                            "types",
                            "corpora",
                            "total"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "facets"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/{artifactId}": {
      "get": {
        "operationId": "Artifact_get",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "artifact": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "nameSlug": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "producedByRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "linkedAgentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "linkedAgentIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "createdAt",
                            "updatedAt",
                            "linkedAgentCount",
                            "linkedAgentIds"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "artifact"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Artifact_delete",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/{artifactId}/graph-context": {
      "get": {
        "operationId": "Artifact_graphContext",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "slug",
                              "artifactId",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "links"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/{artifactId}/versions": {
      "get": {
        "operationId": "Artifact_listVersions",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "versionNumber": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "contentHash": {
                                "type": "string",
                                "minLength": 1
                              },
                              "contentKey": {
                                "type": "string"
                              },
                              "filename": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "isActive": {
                                "type": "boolean"
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "upload",
                                  "template_clone",
                                  "sync",
                                  "changeset_adopt",
                                  "changeset_revert"
                                ]
                              },
                              "externalRevisionId": {
                                "type": "string"
                              },
                              "createdBy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "versionNumber",
                              "contentHash",
                              "contentKey",
                              "mimeType",
                              "isActive",
                              "source",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "versions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Artifact_createVersion",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "mimeType": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "version": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1
                            },
                            "contentKey": {
                              "type": "string"
                            },
                            "filename": {
                              "type": "string"
                            },
                            "mimeType": {
                              "type": "string"
                            },
                            "sizeBytes": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "upload",
                                "template_clone",
                                "sync",
                                "changeset_adopt",
                                "changeset_revert"
                              ]
                            },
                            "externalRevisionId": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "versionNumber",
                            "contentHash",
                            "contentKey",
                            "mimeType",
                            "isActive",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/{artifactId}/versions/{versionId}/promote": {
      "post": {
        "operationId": "Artifact_promoteVersion",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "promoted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "promoted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/artifacts/{artifactId}/versions/{versionId}/content": {
      "get": {
        "operationId": "Artifact_getVersionContent",
        "tags": [
          "Artifact"
        ],
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "string"
                        },
                        "mimeType": {
                          "type": "string"
                        },
                        "contentBase64": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "content",
                        "mimeType"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/billing/summary": {
      "get": {
        "operationId": "Billing_summary",
        "tags": [
          "Billing"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "profile": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tier": {
                              "type": "string",
                              "enum": [
                                "free",
                                "business",
                                "enterprise",
                                "staff"
                              ]
                            },
                            "billingMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "stripe",
                                "manual_invoice",
                                "staff"
                              ]
                            },
                            "paymentStatus": {
                              "type": "string",
                              "enum": [
                                "not_required",
                                "active",
                                "past_due",
                                "canceled",
                                "manual"
                              ]
                            },
                            "stripeCustomerId": {
                              "type": "string"
                            },
                            "stripeSubscriptionId": {
                              "type": "string"
                            },
                            "manualArrangementId": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "tier",
                            "billingMode",
                            "paymentStatus",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "entitlement": {
                          "type": "object",
                          "properties": {
                            "tier": {
                              "type": "string",
                              "enum": [
                                "free",
                                "business",
                                "enterprise",
                                "staff"
                              ]
                            },
                            "label": {
                              "type": "string"
                            },
                            "requiresPayment": {
                              "type": "boolean"
                            },
                            "monthlyPlatformLlmTokenLimit": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "monthlyOperationMsLimit": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "platformModelIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "byokAllowsAllCatalogModels": {
                              "type": "boolean"
                            },
                            "usageBilling": {
                              "type": "string",
                              "enum": [
                                "included",
                                "metered",
                                "manual"
                              ]
                            }
                          },
                          "required": [
                            "tier",
                            "label",
                            "requiresPayment",
                            "byokAllowsAllCatalogModels",
                            "usageBilling"
                          ],
                          "additionalProperties": false
                        },
                        "periodStart": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "usage": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "meterName": {
                                "type": "string",
                                "enum": [
                                  "platform_llm_tokens",
                                  "byok_llm_tokens",
                                  "operation_ms"
                                ]
                              },
                              "quantity": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "billableCents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "meterName",
                              "quantity",
                              "billableCents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "profile",
                        "entitlement",
                        "periodStart",
                        "usage"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/evidence": {
      "post": {
        "operationId": "BrainLiveDataPlane_submitEvidence",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Submit BYO evidence (raw source content) to the Brain.",
        "description": "The BYO-ingestion entry point: hand the Brain a piece of source content under a caller-owned locator (`metadata`), which becomes an Artifact this Connection can later extract from (`POST .../artifacts/:artifactId/extract`) or cite from a mutation's `provenance.source`. Idempotent on `idempotencyKey` — replaying the same key and body returns the same `evidenceId`/`versionId`. Requires the `submit_evidence` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "submit_evidence",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "evidenceId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "contentHash": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "mediaType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 16777220
                  },
                  "encoding": {
                    "type": "string",
                    "enum": [
                      "utf8",
                      "base64"
                    ]
                  },
                  "metadata": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "credentialGrantId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "principal": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "user",
                              "service",
                              "agent",
                              "oauth_client"
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        },
                        "required": [
                          "kind",
                          "id"
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "human",
                          "agent",
                          "pipeline",
                          "propagation",
                          "system"
                        ]
                      },
                      "evidence": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "evidenceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "anchor": {
                              "type": "object",
                              "properties": {
                                "locator": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "fragmentHash": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "quote": {
                                  "type": "string",
                                  "maxLength": 65536
                                }
                              },
                              "required": [
                                "locator",
                                "fragmentHash"
                              ]
                            }
                          },
                          "required": [
                            "evidenceId",
                            "versionId",
                            "contentHash"
                          ]
                        }
                      },
                      "intent": {
                        "type": "string",
                        "minLength": 1
                      },
                      "confidence": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "causingRunId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "parentChangeSetId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "connectionId",
                      "credentialGrantId",
                      "principal",
                      "origin",
                      "evidence"
                    ]
                  }
                },
                "required": [
                  "idempotencyKey",
                  "expectedGeneration",
                  "contentHash",
                  "content",
                  "encoding",
                  "metadata",
                  "provenance"
                ]
              },
              "example": {
                "idempotencyKey": "outreach-notes-2026-08-12-call-48213",
                "expectedGeneration": "gen_01J8Z3K7QW",
                "contentHash": "sha256:9f2c1a7e4b6d8f0e2c4a6b8d0f2e4c6a",
                "content": "IyBSaWRnZWxpbmUgY2FsbCBub3Rlcw==",
                "encoding": "base64",
                "metadata": {
                  "source": "customer-crm",
                  "locator": "crm://call/48213"
                },
                "provenance": {
                  "actor": {
                    "kind": "agent",
                    "agentId": "company-os-outreach-agent"
                  },
                  "origin": "emitted"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "evidenceId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "versionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "artifactId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "contentHash": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "mediaType": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "metadata": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "submittedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "principal": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "service",
                                    "agent",
                                    "oauth_client"
                                  ]
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "kind",
                                "id"
                              ],
                              "additionalProperties": false
                            },
                            "origin": {
                              "type": "string",
                              "enum": [
                                "human",
                                "agent",
                                "pipeline",
                                "propagation",
                                "system"
                              ]
                            },
                            "evidence": {
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "anchor": {
                                    "type": "object",
                                    "properties": {
                                      "locator": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "fragmentHash": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "quote": {
                                        "type": "string",
                                        "maxLength": 65536
                                      }
                                    },
                                    "required": [
                                      "locator",
                                      "fragmentHash"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "versionId",
                                  "contentHash"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "intent": {
                              "type": "string",
                              "minLength": 1
                            },
                            "confidence": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1
                            },
                            "causingRunId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "parentChangeSetId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            }
                          },
                          "required": [
                            "connectionId",
                            "credentialGrantId",
                            "principal",
                            "origin",
                            "evidence"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "evidenceId",
                        "versionId",
                        "artifactId",
                        "contentHash",
                        "metadata",
                        "submittedAt",
                        "provenance"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "evidenceId": "evid_01J8Z3M2NX",
                    "versionId": "evidv_01J8Z3M2NY",
                    "artifactId": "art_01J8Z3M2P0",
                    "contentHash": "sha256:9f2c1a7e4b6d8f0e2c4a6b8d0f2e4c6a",
                    "mediaType": "text/markdown",
                    "sizeBytes": 812,
                    "metadata": {
                      "source": "customer-crm",
                      "locator": "crm://call/48213"
                    },
                    "submittedAt": "2026-08-12T15:04:00Z",
                    "provenance": {
                      "actor": {
                        "kind": "agent",
                        "agentId": "company-os-outreach-agent"
                      },
                      "origin": "emitted"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/mutations": {
      "post": {
        "operationId": "BrainLiveDataPlane_submitMutations",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Submit one idempotent, atomic typed-mutation batch.",
        "description": "The one write path for typed entities, Markdown bodies, and relationships. `create_entity + edit_body + link` in the same batch can target entities created earlier in that SAME batch. The whole batch admits or requires review together — never partially. Idempotent on `idempotencyKey`: replaying the same key + body returns the stored outcome; a NEW key with an identical semantic result should not be sent — resolve to `no_changes` client-side instead, since an empty `mutations` array is durably rejected. Requires the `submit_mutations` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "submit_mutations",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "expectedSnapshot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "mutations": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "create_entity"
                            },
                            "entityKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fields": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "entityKind",
                            "fields"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "delete_entity"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "set_field"
                            },
                            "field": {
                              "type": "string",
                              "minLength": 1
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "field"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "retype_entity"
                            },
                            "fromKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toKind": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "fromKind",
                            "toKind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "link"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "unlink"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "edit_body"
                            },
                            "proposedBody": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "proposedBody"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "evolve_schema"
                            },
                            "schemaSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "delta": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "impact": {
                              "type": "object",
                              "properties": {
                                "entitiesAffected": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "fieldsLost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "entitiesAffected",
                                "fieldsLost"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseSchemaVersion": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "kind",
                            "schemaSlug",
                            "delta",
                            "impact",
                            "provenance"
                          ]
                        }
                      ]
                    }
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "credentialGrantId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "principal": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "user",
                              "service",
                              "agent",
                              "oauth_client"
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        },
                        "required": [
                          "kind",
                          "id"
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "human",
                          "agent",
                          "pipeline",
                          "propagation",
                          "system"
                        ]
                      },
                      "evidence": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "evidenceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "anchor": {
                              "type": "object",
                              "properties": {
                                "locator": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "fragmentHash": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "quote": {
                                  "type": "string",
                                  "maxLength": 65536
                                }
                              },
                              "required": [
                                "locator",
                                "fragmentHash"
                              ]
                            }
                          },
                          "required": [
                            "evidenceId",
                            "versionId",
                            "contentHash"
                          ]
                        }
                      },
                      "intent": {
                        "type": "string",
                        "minLength": 1
                      },
                      "confidence": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "causingRunId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "parentChangeSetId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "connectionId",
                      "credentialGrantId",
                      "principal",
                      "origin",
                      "evidence"
                    ]
                  }
                },
                "required": [
                  "idempotencyKey",
                  "expectedGeneration",
                  "mutations",
                  "provenance"
                ]
              },
              "example": {
                "idempotencyKey": "bob-outreach-2026-08-12-lead-create",
                "expectedGeneration": "gen_01J8Z3K7QW",
                "mutations": [
                  {
                    "kind": "create_entity",
                    "target": {
                      "entityKind": "person",
                      "slug": "bob-smith-project-y"
                    },
                    "entityKind": "person",
                    "fields": {
                      "name": "Bob Smith",
                      "email": "bob@projecty.example"
                    },
                    "provenance": {
                      "actor": {
                        "kind": "agent",
                        "agentId": "company-os-outreach-agent"
                      },
                      "origin": "emitted"
                    }
                  },
                  {
                    "kind": "create_entity",
                    "target": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead"
                    },
                    "entityKind": "lead",
                    "fields": {
                      "stage": "qualifying"
                    },
                    "provenance": {
                      "actor": {
                        "kind": "agent",
                        "agentId": "company-os-outreach-agent"
                      },
                      "origin": "emitted"
                    }
                  }
                ],
                "provenance": {
                  "actor": {
                    "kind": "agent",
                    "agentId": "company-os-outreach-agent"
                  },
                  "origin": "emitted"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "admitted"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "eventIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "policyVersionId",
                            "acceptedSnapshot",
                            "eventIds"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "review_required"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "proposalId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "rejected"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "rejectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "rejectionId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "data": {
                    "kind": "admitted",
                    "batchId": "batch_01J8Z3N4RT",
                    "policyVersionId": "policyv_01J7X1A2BC",
                    "acceptedSnapshot": "snap_01J8Z3N4RU",
                    "eventIds": [
                      "evt_01J8Z3N4RV",
                      "evt_01J8Z3N4RW"
                    ],
                    "records": [
                      {
                        "entityKind": "person",
                        "slug": "bob-smith-project-y",
                        "artifactVersionId": "artv_01J8Z3N4RX"
                      },
                      {
                        "entityKind": "lead",
                        "slug": "bob-smith-project-y-lead",
                        "artifactVersionId": "artv_01J8Z3N4RY"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/mutations/{batchId}": {
      "get": {
        "operationId": "BrainLiveDataPlane_getMutationOutcome",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Look up a previously submitted mutation batch's outcome.",
        "description": "Re-fetches the outcome `submitMutations` returned for `batchId` — the recovery path after a client-side timeout on the original request, before deciding whether to retry with the same `idempotencyKey`. Requires the `submit_mutations` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP. Same capability as submitting: reading a batch's outcome is part of owning that write, not a separate read privilege.",
        "x-nicia-capability": "submit_mutations",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "admitted"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "eventIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "policyVersionId",
                            "acceptedSnapshot",
                            "eventIds"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "review_required"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "proposalId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "rejected"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "rejectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "rejectionId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "data": {
                    "kind": "admitted",
                    "batchId": "batch_01J8Z3N4RT",
                    "policyVersionId": "policyv_01J7X1A2BC",
                    "acceptedSnapshot": "snap_01J8Z3N4RU",
                    "eventIds": [
                      "evt_01J8Z3N4RV",
                      "evt_01J8Z3N4RW"
                    ],
                    "records": [
                      {
                        "entityKind": "person",
                        "slug": "bob-smith-project-y",
                        "artifactVersionId": "artv_01J8Z3N4RX"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/corrections": {
      "post": {
        "operationId": "BrainLiveDataPlane_submitCorrection",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Submit a correction batch, linked to the change it corrects.",
        "description": "Same shape and admission behavior as `submitMutations`, plus `correctsEventId` naming the earlier change this batch supersedes. Not a separate write kind — a correction is this same batch write carrying a first-class link, so `GET .../corrections/:eventId` can answer the correction chain later. Requires the `submit_mutations` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "submit_mutations",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "expectedSnapshot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "correctsEventId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "mutations": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "create_entity"
                            },
                            "entityKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fields": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "entityKind",
                            "fields"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "delete_entity"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "set_field"
                            },
                            "field": {
                              "type": "string",
                              "minLength": 1
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "field"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "retype_entity"
                            },
                            "fromKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toKind": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "fromKind",
                            "toKind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "link"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "unlink"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "edit_body"
                            },
                            "proposedBody": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "proposedBody"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "evolve_schema"
                            },
                            "schemaSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "delta": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "impact": {
                              "type": "object",
                              "properties": {
                                "entitiesAffected": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "fieldsLost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "entitiesAffected",
                                "fieldsLost"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseSchemaVersion": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "kind",
                            "schemaSlug",
                            "delta",
                            "impact",
                            "provenance"
                          ]
                        }
                      ]
                    }
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "credentialGrantId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "principal": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "user",
                              "service",
                              "agent",
                              "oauth_client"
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        },
                        "required": [
                          "kind",
                          "id"
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "human",
                          "agent",
                          "pipeline",
                          "propagation",
                          "system"
                        ]
                      },
                      "evidence": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "evidenceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "anchor": {
                              "type": "object",
                              "properties": {
                                "locator": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "fragmentHash": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "quote": {
                                  "type": "string",
                                  "maxLength": 65536
                                }
                              },
                              "required": [
                                "locator",
                                "fragmentHash"
                              ]
                            }
                          },
                          "required": [
                            "evidenceId",
                            "versionId",
                            "contentHash"
                          ]
                        }
                      },
                      "intent": {
                        "type": "string",
                        "minLength": 1
                      },
                      "confidence": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "causingRunId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "parentChangeSetId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "connectionId",
                      "credentialGrantId",
                      "principal",
                      "origin",
                      "evidence"
                    ]
                  }
                },
                "required": [
                  "idempotencyKey",
                  "expectedGeneration",
                  "correctsEventId",
                  "mutations",
                  "provenance"
                ]
              },
              "example": {
                "idempotencyKey": "bob-lead-stage-correction-2026-08-12",
                "expectedGeneration": "gen_01J8Z3K7QW",
                "correctsEventId": "evt_01J8Z3N4RW",
                "mutations": [
                  {
                    "kind": "set_field",
                    "target": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead"
                    },
                    "field": "stage",
                    "value": "qualified",
                    "provenance": {
                      "actor": {
                        "kind": "human",
                        "userId": "user_01J7X1A2BH"
                      },
                      "origin": "emitted"
                    }
                  }
                ],
                "provenance": {
                  "actor": {
                    "kind": "human",
                    "userId": "user_01J7X1A2BH"
                  },
                  "origin": "emitted"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "admitted"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "eventIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "policyVersionId",
                            "acceptedSnapshot",
                            "eventIds"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "review_required"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "proposalId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "rejected"
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "rejectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "reasons": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "batchId",
                            "rejectionId",
                            "policyVersionId",
                            "reasons"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "data": {
                    "kind": "admitted",
                    "batchId": "batch_01J8Z3Q1UZ",
                    "policyVersionId": "policyv_01J7X1A2BC",
                    "acceptedSnapshot": "snap_01J8Z3Q1V0",
                    "eventIds": [
                      "evt_01J8Z3Q1V1"
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/corrections/{eventId}": {
      "get": {
        "operationId": "BrainLiveDataPlane_getCorrectionChain",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Walk a change event's full correction chain.",
        "description": "`eventIds` lists the chain in order — the original change plus every correction that superseded it, oldest first. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "eventIds": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        }
                      },
                      "required": [
                        "eventIds"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "eventIds": [
                      "evt_01J8Z3N4RW",
                      "evt_01J8Z3Q1V1"
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/corrections/{eventId}/affected-reads": {
      "get": {
        "operationId": "BrainLiveDataPlane_listAffectedReads",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "List receipts that read the pre-correction version.",
        "description": "Who is affected by this correction — every receipted read that observed the version `eventId` superseded, so a consumer holding one of these receipts knows to re-request context. Cursor-paginated. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 250
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "receiptId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "structured_read",
                                  "context",
                                  "search"
                                ]
                              },
                              "consumerId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "snapshot": {
                                "type": "object",
                                "properties": {
                                  "brainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "generation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "stateVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "schemaVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "recordedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "validAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "brainId",
                                  "generation",
                                  "stateVersion",
                                  "schemaVersion",
                                  "policyVersion",
                                  "recordedAt"
                                ],
                                "additionalProperties": false
                              },
                              "requestHash": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "renderHash": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "items": {
                                "maxItems": 1000,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "semanticId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "versionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "evidenceRefs": {
                                      "maxItems": 100,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "semanticId",
                                    "versionId",
                                    "evidenceRefs"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "committedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "receiptId",
                              "kind",
                              "consumerId",
                              "connectionId",
                              "credentialGrantId",
                              "snapshot",
                              "requestHash",
                              "items",
                              "committedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "receiptId": "receipt_01J8Z3P6ST",
                        "kind": "structured_read",
                        "consumerId": "outreach-drafter",
                        "connectionId": "conn_01J7X1A2BD",
                        "credentialGrantId": "cred_01J7X1A2BE",
                        "snapshot": {
                          "brainId": "brain_01J7X1A2BF",
                          "generation": "gen_01J8Z3K7QW",
                          "stateVersion": "sv_01J8Z3N4RU",
                          "schemaVersion": "schv_01J7X1A2BG",
                          "policyVersion": "policyv_01J7X1A2BC",
                          "recordedAt": "2026-08-12T15:05:00Z"
                        },
                        "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                        "items": [],
                        "committedAt": "2026-08-12T15:05:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/query": {
      "post": {
        "operationId": "BrainLiveDataPlane_queryStructured",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Deterministic identity resolution by exact typed fields.",
        "description": "The bounded, exact-match identity-resolution path — resolve an existing entity by `semanticIds`/`recordKind` before deciding whether a mutation batch needs `create_entity` or an exact-base update. Every query is receipted: the response's `receipt` is a durable, replayable record of exactly which versions this read saw. Requires the `query` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "query",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "query": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "source_backed_entities"
                          },
                          "semanticIds": {
                            "maxItems": 100,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "recordKind": {
                            "type": "string",
                            "minLength": 1
                          },
                          "predicates": {
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "op": {
                                      "type": "string",
                                      "const": "eq"
                                    },
                                    "value": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "op",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "op": {
                                      "type": "string",
                                      "const": "has"
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "op",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "includeBody": {
                            "type": "boolean"
                          },
                          "cursor": {
                            "type": "string",
                            "minLength": 1
                          },
                          "limit": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "documents"
                          },
                          "semanticIds": {
                            "maxItems": 100,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "includeBody": {
                            "type": "boolean"
                          },
                          "cursor": {
                            "type": "string",
                            "minLength": 1
                          },
                          "limit": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "temporal": {
                    "type": "object",
                    "properties": {
                      "snapshot": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "validAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "recordedAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      }
                    }
                  },
                  "consumerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "required": [
                  "query",
                  "consumerId"
                ]
              },
              "example": {
                "query": {
                  "semanticIds": [
                    "bob@projecty.example"
                  ],
                  "recordKind": "person"
                },
                "consumerId": "outreach-drafter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "fields": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "evidenceRefs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "validFrom": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "validUntil": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "recordedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "kind",
                                  "fields",
                                  "evidenceRefs",
                                  "recordedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "nextCursor": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            }
                          },
                          "required": [
                            "items"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "items": []
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3P6ST",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [],
                      "committedAt": "2026-08-12T15:05:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/context": {
      "post": {
        "operationId": "BrainLiveDataPlane_requestContext",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Request grounded, receipted context for a prompt.",
        "description": "Server-composed retrieval over the Brain, bounded to `maxTokens`. The response carries a `receipt` — retain it and reconstruct it later (`GET .../receipts/:receiptId/reconstruction`) to ground a customer-visible output at the SAME versions this read saw, even after the Brain has since changed. Requires the `request_context` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "request_context",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32768
                  },
                  "consumerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "maxTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 8192
                  },
                  "temporal": {
                    "type": "object",
                    "properties": {
                      "snapshot": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "validAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "recordedAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      }
                    }
                  },
                  "options": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "prompt",
                  "consumerId"
                ]
              },
              "example": {
                "prompt": "What does Nicia's AI Company ICP say about Project Y?",
                "consumerId": "outreach-drafter",
                "maxTokens": 2000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            }
                          },
                          "required": [
                            "text",
                            "items",
                            "metadata"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "text": "Project Y matches the AI Company ICP on…",
                      "items": [],
                      "metadata": {}
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3P8VW",
                      "kind": "context",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:1a3c5e7b9d1f3a5c7e9d1b3f5a7c9e1d",
                      "items": [],
                      "committedAt": "2026-08-12T15:06:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/context/custom": {
      "post": {
        "operationId": "BrainLiveDataPlane_commitCustomContext",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Commit a receipt for context the caller assembled itself.",
        "description": "For an integrator that composes its own prompt from data it already fetched through other Brain reads, rather than using `requestContext`'s server-side composition — this still records a durable, reconstructable receipt over the caller-supplied snapshot and item list, so a self-assembled context gets the same grounding guarantee. Requires the `request_context` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "request_context",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "consumerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "snapshot": {
                    "type": "object",
                    "properties": {
                      "brainId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "generation": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "stateVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "schemaVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "policyVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "recordedAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "validAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      }
                    },
                    "required": [
                      "brainId",
                      "generation",
                      "stateVersion",
                      "schemaVersion",
                      "policyVersion",
                      "recordedAt"
                    ]
                  },
                  "requestHash": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "renderHash": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "items": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "semanticId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "versionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "evidenceRefs": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "evidenceId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "versionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contentHash": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "anchor": {
                                "type": "object",
                                "properties": {
                                  "locator": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "fragmentHash": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "quote": {
                                    "type": "string",
                                    "maxLength": 65536
                                  }
                                },
                                "required": [
                                  "locator",
                                  "fragmentHash"
                                ]
                              }
                            },
                            "required": [
                              "evidenceId",
                              "versionId",
                              "contentHash"
                            ]
                          }
                        }
                      },
                      "required": [
                        "semanticId",
                        "versionId",
                        "evidenceRefs"
                      ]
                    }
                  }
                },
                "required": [
                  "consumerId",
                  "snapshot",
                  "requestHash",
                  "renderHash",
                  "items"
                ]
              },
              "example": {
                "consumerId": "outreach-drafter",
                "snapshot": {
                  "brainId": "brain_01J7X1A2BF",
                  "generation": "gen_01J8Z3K7QW",
                  "stateVersion": "sv_01J8Z3N4RU",
                  "schemaVersion": "schv_01J7X1A2BG",
                  "policyVersion": "policyv_01J7X1A2BC",
                  "recordedAt": "2026-08-12T15:05:00Z"
                },
                "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                "renderHash": "sha256:1a3c5e7b9d1f3a5c7e9d1b3f5a7c9e1d",
                "items": [
                  {
                    "semanticId": "bob@projecty.example",
                    "versionId": "artv_01J8Z3N4RX",
                    "evidenceRefs": []
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "receiptId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "structured_read",
                            "context",
                            "search"
                          ]
                        },
                        "consumerId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "credentialGrantId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "requestHash": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "renderHash": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "items": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "semanticId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "versionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "evidenceRefs": {
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "evidenceId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "versionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "contentHash": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "anchor": {
                                      "type": "object",
                                      "properties": {
                                        "locator": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {}
                                        },
                                        "fragmentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "quote": {
                                          "type": "string",
                                          "maxLength": 65536
                                        }
                                      },
                                      "required": [
                                        "locator",
                                        "fragmentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "evidenceId",
                                    "versionId",
                                    "contentHash"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "semanticId",
                              "versionId",
                              "evidenceRefs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "committedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "receiptId",
                        "kind",
                        "consumerId",
                        "connectionId",
                        "credentialGrantId",
                        "snapshot",
                        "requestHash",
                        "items",
                        "committedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "receiptId": "receipt_01J8Z3PA1X",
                    "kind": "context",
                    "consumerId": "outreach-drafter",
                    "connectionId": "conn_01J7X1A2BD",
                    "credentialGrantId": "cred_01J7X1A2BE",
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                    "items": [
                      {
                        "semanticId": "bob@projecty.example",
                        "versionId": "artv_01J8Z3N4RX",
                        "evidenceRefs": []
                      }
                    ],
                    "committedAt": "2026-08-12T15:07:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/receipts/{receiptId}": {
      "get": {
        "operationId": "BrainLiveDataPlane_getReceipt",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Fetch a receipt by id.",
        "description": "Isolated to the Connection that produced it — a receipt fetched by a DIFFERENT Connection's credential 404s, even within the same Brain and organization. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "receiptId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "structured_read",
                            "context",
                            "search"
                          ]
                        },
                        "consumerId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "connectionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "credentialGrantId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "requestHash": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "renderHash": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "items": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "semanticId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "versionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "evidenceRefs": {
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "evidenceId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "versionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "contentHash": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "anchor": {
                                      "type": "object",
                                      "properties": {
                                        "locator": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {}
                                        },
                                        "fragmentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "quote": {
                                          "type": "string",
                                          "maxLength": 65536
                                        }
                                      },
                                      "required": [
                                        "locator",
                                        "fragmentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "evidenceId",
                                    "versionId",
                                    "contentHash"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "semanticId",
                              "versionId",
                              "evidenceRefs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "committedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "receiptId",
                        "kind",
                        "consumerId",
                        "connectionId",
                        "credentialGrantId",
                        "snapshot",
                        "requestHash",
                        "items",
                        "committedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "receiptId": "receipt_01J8Z3P6ST",
                    "kind": "structured_read",
                    "consumerId": "outreach-drafter",
                    "connectionId": "conn_01J7X1A2BD",
                    "credentialGrantId": "cred_01J7X1A2BE",
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                    "items": [],
                    "committedAt": "2026-08-12T15:05:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/receipts/{receiptId}/reconstruction": {
      "get": {
        "operationId": "BrainLiveDataPlane_reconstructReceipt",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Rehydrate the exact versions a past receipt read.",
        "description": "Grounds a customer-visible output against what the Brain looked like at read time, not now — each item's `availability` reports whether that exact version is still current, was superseded by a correction, or is on hold/deleted. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "item": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              },
                              "availability": {
                                "type": "string",
                                "enum": [
                                  "available",
                                  "corrected",
                                  "held",
                                  "deleted"
                                ]
                              }
                            },
                            "required": [
                              "item",
                              "availability"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "receipt",
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "receipt": {
                      "receiptId": "receipt_01J8Z3P6ST",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [
                        {
                          "semanticId": "bob@projecty.example",
                          "versionId": "artv_01J8Z3N4RX",
                          "evidenceRefs": []
                        }
                      ],
                      "committedAt": "2026-08-12T15:05:00Z"
                    },
                    "items": [
                      {
                        "item": {
                          "semanticId": "bob@projecty.example",
                          "versionId": "artv_01J8Z3N4RX",
                          "evidenceRefs": []
                        },
                        "availability": "available"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/receipts": {
      "get": {
        "operationId": "BrainLiveDataPlane_listReceipts",
        "tags": [
          "BrainLiveDataPlane"
        ],
        "summary": "Page through this Connection's own receipts by consumer.",
        "description": "`consumerId` is required — receipts are always listed for one logical consumer at a time (`x-external-run-id`-style correlation), never Brain-wide. Cursor-paginated; `nextCursor` absent means the last page. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 250
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "structured_read",
                "context"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "receiptId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "structured_read",
                                  "context",
                                  "search"
                                ]
                              },
                              "consumerId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "snapshot": {
                                "type": "object",
                                "properties": {
                                  "brainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "generation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "stateVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "schemaVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "recordedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "validAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "brainId",
                                  "generation",
                                  "stateVersion",
                                  "schemaVersion",
                                  "policyVersion",
                                  "recordedAt"
                                ],
                                "additionalProperties": false
                              },
                              "requestHash": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "renderHash": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "items": {
                                "maxItems": 1000,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "semanticId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "versionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "evidenceRefs": {
                                      "maxItems": 100,
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "semanticId",
                                    "versionId",
                                    "evidenceRefs"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "committedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "receiptId",
                              "kind",
                              "consumerId",
                              "connectionId",
                              "credentialGrantId",
                              "snapshot",
                              "requestHash",
                              "items",
                              "committedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "receiptId": "receipt_01J8Z3P6ST",
                        "kind": "structured_read",
                        "consumerId": "outreach-drafter",
                        "connectionId": "conn_01J7X1A2BD",
                        "credentialGrantId": "cred_01J7X1A2BE",
                        "snapshot": {
                          "brainId": "brain_01J7X1A2BF",
                          "generation": "gen_01J8Z3K7QW",
                          "stateVersion": "sv_01J8Z3N4RU",
                          "schemaVersion": "schv_01J7X1A2BG",
                          "policyVersion": "policyv_01J7X1A2BC",
                          "recordedAt": "2026-08-12T15:05:00Z"
                        },
                        "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                        "items": [],
                        "committedAt": "2026-08-12T15:05:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}": {
      "put": {
        "operationId": "BrainV2_put",
        "tags": [
          "BrainV2"
        ],
        "summary": "Create or update a Brain",
        "description": "Idempotent on the handle you choose. Returns 201 the first time and 200 thereafter. The handle is the address: every operation on this surface takes it, and none asks for an id back. The response also carries the Brain's opaque platform `id`, which is what the older id-addressed paths take — store it only if you call one of those. To change an existing Brain's name, purpose, or mode with a Brain key, use `PATCH /v1/brains/{handle}`. Send `ifExists: \"conflict\"` when the call is a CREATE rather than a reconcile: a taken handle then answers 409 instead of being edited. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "schema": {
                    "description": "Slug of a pack, or an inline schema. Defaults to `nicia-base`; select `nicia-core` explicitly to get the domain-neutral vocabulary.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "extends": {
                            "type": "string"
                          },
                          "kinds": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64,
                                  "pattern": "^[a-z][a-z0-9_]*$"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "fields": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "string",
                                          "number",
                                          "boolean",
                                          "enum",
                                          "string_list"
                                        ]
                                      },
                                      "values": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "description": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "type"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "fields"
                              ]
                            }
                          },
                          "links": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "from": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  }
                                },
                                "to": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "from",
                                "to"
                              ]
                            }
                          }
                        },
                        "required": [
                          "kinds"
                        ]
                      }
                    ]
                  },
                  "mode": {
                    "description": "Defaults to `open`.",
                    "type": "string",
                    "enum": [
                      "open",
                      "reviewed"
                    ]
                  },
                  "subject": {
                    "description": "What this Brain is about. Omit it and one is derived from the handle and name. Recorded when the Brain is created.",
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "externalId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "kind",
                      "label"
                    ]
                  },
                  "revive": {
                    "description": "Re-create a tombstoned handle deliberately.",
                    "type": "boolean"
                  },
                  "ifExists": {
                    "description": "What a taken handle means. `update` (the default) edits the Brain in place; `conflict` refuses with 409 unless this request states nothing different from what is stored.",
                    "type": "string",
                    "enum": [
                      "update",
                      "conflict"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brain": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "description": "The Brain's opaque platform id. The handle is the address on this surface; this id is what the older id-addressed paths take."
                            },
                            "handle": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200,
                              "pattern": "^[^/\\s]+$",
                              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
                            },
                            "name": {
                              "type": "string"
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "schema": {
                              "type": "string",
                              "description": "Schema slug in force. A Brain created through this surface and naming no schema starts on `nicia-base`, the default starter vocabulary."
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "open",
                                "reviewed"
                              ]
                            },
                            "documentCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name",
                            "schema",
                            "mode",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "brain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brain": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "description": "The Brain's opaque platform id. The handle is the address on this surface; this id is what the older id-addressed paths take."
                            },
                            "handle": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200,
                              "pattern": "^[^/\\s]+$",
                              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
                            },
                            "name": {
                              "type": "string"
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "schema": {
                              "type": "string",
                              "description": "Schema slug in force. A Brain created through this surface and naming no schema starts on `nicia-base`, the default starter vocabulary."
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "open",
                                "reviewed"
                              ]
                            },
                            "documentCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name",
                            "schema",
                            "mode",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "brain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainV2_get",
        "tags": [
          "BrainV2"
        ],
        "summary": "Get a Brain",
        "description": "Its name, purpose, schema, and the mode writes are admitted under. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`. This returns the Brain's own name, purpose, schema slug, and mode — not its contents.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brain": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "description": "The Brain's opaque platform id. The handle is the address on this surface; this id is what the older id-addressed paths take."
                            },
                            "handle": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200,
                              "pattern": "^[^/\\s]+$",
                              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
                            },
                            "name": {
                              "type": "string"
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "schema": {
                              "type": "string",
                              "description": "Schema slug in force. A Brain created through this surface and naming no schema starts on `nicia-base`, the default starter vocabulary."
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "open",
                                "reviewed"
                              ]
                            },
                            "documentCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name",
                            "schema",
                            "mode",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "brain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "BrainV2_patch",
        "tags": [
          "BrainV2"
        ],
        "summary": "Update a Brain",
        "description": "Rename it, restate its purpose, or switch review on or off. Requires the `admin` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `admin` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`. `mode` is the review switch, so this is the one operation that turns governance on or off — the capability that grants it is `admin`, and `admin` grants no read access to the Brain's contents.",
        "x-nicia-brain-capability": "admin",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "open",
                      "reviewed"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brain": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "description": "The Brain's opaque platform id. The handle is the address on this surface; this id is what the older id-addressed paths take."
                            },
                            "handle": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200,
                              "pattern": "^[^/\\s]+$",
                              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
                            },
                            "name": {
                              "type": "string"
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "schema": {
                              "type": "string",
                              "description": "Schema slug in force. A Brain created through this surface and naming no schema starts on `nicia-base`, the default starter vocabulary."
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "open",
                                "reviewed"
                              ]
                            },
                            "documentCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name",
                            "schema",
                            "mode",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "brain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "BrainV2_delete",
        "tags": [
          "BrainV2"
        ],
        "summary": "Delete a Brain",
        "description": "Tombstoned: the handle stays reserved so a re-running script gets a 409 rather than a silently empty Brain — whichever of the two addresses it used. Receipts still resolve. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains": {
      "get": {
        "operationId": "BrainV2_list",
        "tags": [
          "BrainV2"
        ],
        "summary": "List Brains",
        "description": "Keyset paged. Cursors are opaque and stable under concurrent writes. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "brains": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "description": "The Brain's opaque platform id. The handle is the address on this surface; this id is what the older id-addressed paths take."
                              },
                              "handle": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200,
                                "pattern": "^[^/\\s]+$",
                                "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
                              },
                              "name": {
                                "type": "string"
                              },
                              "purpose": {
                                "type": "string"
                              },
                              "schema": {
                                "type": "string",
                                "description": "Schema slug in force. A Brain created through this surface and naming no schema starts on `nicia-base`, the default starter vocabulary."
                              },
                              "mode": {
                                "type": "string",
                                "enum": [
                                  "open",
                                  "reviewed"
                                ]
                              },
                              "documentCount": {
                                "description": "Not sent by any read today; absent does not mean zero.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "recordCount": {
                                "description": "Not sent by any read today; absent does not mean zero.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name",
                              "schema",
                              "mode",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "brains"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/keys": {
      "post": {
        "operationId": "BrainV2Key_mint",
        "tags": [
          "BrainV2Key"
        ],
        "summary": "Mint a Brain key",
        "description": "Scoped to this Brain and these capabilities. The secret is returned exactly once; a replay of the same idempotency key returns the record with a null secret. A key carries no admission setting of its own — whether a write lands or stages is the Brain's `mode`, decided by policy for every write, whoever sent it. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "capabilities": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "write",
                        "review",
                        "admin"
                      ]
                    }
                  },
                  "client": {
                    "type": "string",
                    "enum": [
                      "api",
                      "mcp",
                      "claude-code",
                      "codex",
                      "cursor",
                      "cli"
                    ]
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "name",
                  "capabilities"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "capabilities": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "write",
                                  "review",
                                  "admin"
                                ]
                              }
                            },
                            "client": {
                              "type": "string",
                              "enum": [
                                "api",
                                "mcp",
                                "claude-code",
                                "codex",
                                "cursor",
                                "cli"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "revoked",
                                "expired"
                              ]
                            },
                            "lastUsedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "capabilities",
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "secret": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainV2Key_list",
        "tags": [
          "BrainV2Key"
        ],
        "summary": "List Brain keys",
        "description": "Redacted — a secret is shown once, at mint. Includes `lastUsedAt`, so unused keys are findable. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 250
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "keys": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "capabilities": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "read",
                                    "write",
                                    "review",
                                    "admin"
                                  ]
                                }
                              },
                              "client": {
                                "type": "string",
                                "enum": [
                                  "api",
                                  "mcp",
                                  "claude-code",
                                  "codex",
                                  "cursor",
                                  "cli"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "revoked",
                                  "expired"
                                ]
                              },
                              "lastUsedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "capabilities",
                              "status",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "keys"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/keys/{keyId}/rotate": {
      "post": {
        "operationId": "BrainV2Key_rotate",
        "tags": [
          "BrainV2Key"
        ],
        "summary": "Rotate a Brain key",
        "description": "Mints a replacement and keeps the old secret working for 60 seconds, so a running fleet does not drop requests while it redeploys. Deploy the new secret inside that window; revoke is immediate and is the way to end a compromised key now. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "capabilities": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "write",
                                  "review",
                                  "admin"
                                ]
                              }
                            },
                            "client": {
                              "type": "string",
                              "enum": [
                                "api",
                                "mcp",
                                "claude-code",
                                "codex",
                                "cursor",
                                "cli"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "revoked",
                                "expired"
                              ]
                            },
                            "lastUsedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "capabilities",
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "secret": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/keys/{keyId}": {
      "delete": {
        "operationId": "BrainV2Key_revoke",
        "tags": [
          "BrainV2Key"
        ],
        "summary": "Revoke a Brain key",
        "description": "Takes effect on the next request, everywhere. Management-only: send an `nsk_` management key — as `Authorization: Bearer <key>` or as `x-api-key` — or call it from a signed-in session. An `nbk_` Brain key cannot create, delete, or issue access to a Brain: there is no capability that would make it correct, since the key operations mint the credentials this plane authenticates with.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "revoked": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "revoked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/documents": {
      "post": {
        "operationId": "BrainV2Document_write",
        "tags": [
          "BrainV2Document"
        ],
        "summary": "Write documents",
        "description": "One document or a batch of up to 100, each indexed independently so one bad document does not fail the rest. Requires the `write` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `write` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "write",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "description": "Your id. Sending one makes the write an idempotent upsert.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1
                      },
                      "metadata": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            }
                          ]
                        }
                      },
                      "occurredAt": {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                      },
                      "extract": {
                        "description": "Set false to index the text without extracting records.",
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "documents": {
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Your id. Sending one makes the write an idempotent upsert.",
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "text": {
                              "type": "string",
                              "minLength": 1
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "occurredAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "extract": {
                              "description": "Set false to index the text without extracting records.",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "text"
                          ]
                        }
                      }
                    },
                    "required": [
                      "documents"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "document": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "processing",
                                    "indexed",
                                    "rejected"
                                  ]
                                },
                                "chunks": {
                                  "description": "Not sent by any read today; absent does not mean zero.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "error": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "document"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "documents": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "queued",
                                      "processing",
                                      "indexed",
                                      "rejected"
                                    ]
                                  },
                                  "chunks": {
                                    "description": "Not sent by any read today; absent does not mean zero.",
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "error": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "documents"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainV2Document_list",
        "tags": [
          "BrainV2Document"
        ],
        "summary": "List documents",
        "description": "Every document SUBMITTED to this Brain over the API. Content that reached the Brain another way, such as a synced folder or URL source, has no submission to list and no document id to address, but it is still read by `/context`, `/query`, and `/search`: this listing is what you sent, not everything the Brain can answer from. Keyset paged by document id, ascending, so a page boundary holds while the Brain is being written to. One entry per document, at its current version. Up to 200 per page; 50 by default. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "documents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Your id for this document."
                              },
                              "title": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "queued",
                                  "processing",
                                  "indexed",
                                  "rejected"
                                ]
                              },
                              "chunks": {
                                "description": "Not sent by any read today; absent does not mean zero.",
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "version": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "metadata": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "occurredAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "error": {
                                "description": "Why the document was rejected, when `status` is `rejected`.",
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "status",
                              "version",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "documents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/documents/{documentId}": {
      "get": {
        "operationId": "BrainV2Document_get",
        "tags": [
          "BrainV2Document"
        ],
        "summary": "Get a document",
        "description": "Carries processing status: queued, processing, indexed, or rejected. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "document": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Your id for this document."
                            },
                            "title": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "processing",
                                "indexed",
                                "rejected"
                              ]
                            },
                            "chunks": {
                              "description": "Not sent by any read today; absent does not mean zero.",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "occurredAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "error": {
                              "description": "Why the document was rejected, when `status` is `rejected`.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "status",
                            "version",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "document"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/documents/{documentId}/records": {
      "get": {
        "operationId": "BrainV2Document_extractedRecords",
        "tags": [
          "BrainV2Document"
        ],
        "summary": "Records extracted from a document",
        "description": "The addresses the Brain read out of this document's prose, and what kind each one is. Read the values themselves through `/context`, `/query`, or the record read, which return them under a receipt. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 509,
                                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                              },
                              "kind": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64,
                                "pattern": "^[a-z][a-z0-9_]*$"
                              }
                            },
                            "required": [
                              "id"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "records"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/records/{id}": {
      "patch": {
        "operationId": "BrainV2Record_merge",
        "tags": [
          "BrainV2Record"
        ],
        "summary": "Merge into a record",
        "description": "Fields you send are set; fields you omit are untouched; a null clears one. Naturally idempotent because the address is the identity. Send `If-Match` with the version you read to make the merge conditional; a stale version is 409. The answer is what the write DID — the address, the version it left, and which of your fields moved — never the record's accepted values, which are a read. A body that states no `kind`, `label`, `fields`, or `links` is a 400: there is nothing to write, and a write is not a way to read. Requires the `write` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `write` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "write",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 509,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "fields": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "links": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 509,
                        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                        "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "record": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 509,
                              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                            },
                            "kind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z][a-z0-9_]*$"
                            },
                            "undeclared": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        },
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Absent when the write moved nothing, and so recorded nothing.",
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "set": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "cleared": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "intent": {
                              "description": "Echoed back from the batch that carried it.",
                              "type": "string"
                            },
                            "fields": {
                              "description": "Which fields actually moved. Empty means the write was a no-op.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "BrainV2Record_replace",
        "tags": [
          "BrainV2Record"
        ],
        "summary": "Replace a record",
        "description": "A declared field you omit is cleared. Frontmatter the schema does not declare is left alone — it is stored data no request showed you, and this surface never returns it, so `PUT` does not erase it either; clear one by sending it as `null`. Send `If-Match` with the version you read for optimistic concurrency; a stale version is 409. Requires the `write` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `write` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "write",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 509,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "fields": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "links": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 509,
                        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                        "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "record": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 509,
                              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                            },
                            "kind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z][a-z0-9_]*$"
                            },
                            "undeclared": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        },
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Absent when the write moved nothing, and so recorded nothing.",
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "set": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "cleared": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "intent": {
                              "description": "Echoed back from the batch that carried it.",
                              "type": "string"
                            },
                            "fields": {
                              "description": "Which fields actually moved. Empty means the write was a no-op.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainV2Record_get",
        "tags": [
          "BrainV2Record"
        ],
        "summary": "Get a record",
        "description": "The addressed read: exactly what `POST /query` returns for this record, one record instead of a page. Includes `sources`, so every value traces to the document or write that produced it. Receipted like every other read — `receipt` is the consumption record, and `GET /receipts/{id}` pins the exact version you were served. `warnings[]` carries the same four kinds as `/context`. An address the Brain holds nothing at is a 404; that read is still receipted, so the consumption log is honest about the attempt. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 509,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "record": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 509,
                              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                            },
                            "kind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z][a-z0-9_]*$"
                            },
                            "label": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "array",
                                    "items": {}
                                  },
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  }
                                ]
                              }
                            },
                            "links": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 509,
                                  "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                  "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                }
                              }
                            },
                            "sources": {
                              "description": "Document ids that produced these values.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "undeclared": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "fields",
                            "version",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "staged": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Changes awaiting review. `null` when the count could not be taken."
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "processing",
                                  "access_scoped",
                                  "truncated",
                                  "staged_pending"
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Why this answer is incomplete; empty when it is not."
                        },
                        "receipt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "record",
                        "staged",
                        "warnings",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "BrainV2Record_delete",
        "tags": [
          "BrainV2Record"
        ],
        "summary": "Delete a record",
        "description": "Staged for review on a reviewed Brain, like any other write. Requires the `write` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `write` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "write",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 509,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Absent when the write moved nothing, and so recorded nothing.",
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "set": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "cleared": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "intent": {
                              "description": "Echoed back from the batch that carried it.",
                              "type": "string"
                            },
                            "fields": {
                              "description": "Which fields actually moved. Empty means the write was a no-op.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/batch": {
      "post": {
        "operationId": "BrainV2Record_batch",
        "tags": [
          "BrainV2Record"
        ],
        "summary": "Write records atomically",
        "description": "Validated and applied as one unit: everything lands, everything stages, or everything is rejected. Records may link to each other. Not addressed, so send an Idempotency-Key to make a retry safe. Every record must state something to write; an entry carrying only an `id` is a 400 for the whole batch. At most 20 records. A record the Brain does not hold yet costs one canonical mutation; updating one costs a mutation per field that actually changes, per link added or removed, plus a retype — against a substrate ceiling of 100 mutations and 2097152 bytes per batch. A batch of wide records can still cross that ceiling and is rejected whole. Requires the `write` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `write` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "write",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "records": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 509,
                          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                          "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                        },
                        "kind": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "fields": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            ]
                          }
                        },
                        "links": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 509,
                              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                              "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                            }
                          }
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "intent": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "records"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "description": "Absent when the write moved nothing, and so recorded nothing.",
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "set": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "cleared": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "intent": {
                              "description": "Echoed back from the batch that carried it.",
                              "type": "string"
                            },
                            "fields": {
                              "description": "Which fields actually moved. Empty means the write was a no-op.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/context": {
      "post": {
        "operationId": "BrainV2Read_context",
        "tags": [
          "BrainV2Read"
        ],
        "summary": "Request context",
        "description": "One prompt in, grounded text and citations out, inside a token budget. Deterministic: no model call, and the same snapshot gives the same answer twice. The whole Brain is in scope — there is no read-time filter; narrow with `POST /query` instead. `warnings[]` says why an answer is less than the whole truth — `processing`, `access_scoped`, `truncated`, `staged_pending` — and is empty when it is not. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32768
                  },
                  "maxTokens": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 8192
                  },
                  "consumerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "description": "Who you are serving this answer to. Recorded on the receipt; defaults to the key that made the call."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "text",
                      "items"
                    ]
                  }
                },
                "required": [
                  "prompt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "citations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "quote": {
                                "type": "string"
                              },
                              "recordedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "slug",
                              "quote"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "document"
                                  },
                                  "id": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "record"
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "fields": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {}
                                        },
                                        {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {}
                                        }
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id",
                                  "fields"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "staged": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Changes awaiting review. `null` when the count could not be taken."
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "processing",
                                  "access_scoped",
                                  "truncated",
                                  "staged_pending"
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Why this answer is incomplete; empty when it is not."
                        },
                        "receipt": {
                          "type": "string"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "omitted": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "text",
                        "citations",
                        "staged",
                        "warnings",
                        "receipt",
                        "truncated"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/search": {
      "get": {
        "operationId": "BrainV2Read_search",
        "tags": [
          "BrainV2Read"
        ],
        "summary": "Search",
        "description": "Ranked retrieval over the Brain's passages, best match first. `fulltext` (the default) is keyword ranking; `hybrid` fuses it with semantic ranking, and degrades to `fulltext` where no embedding provider is configured — the response's `mode` is always the one it actually ranked by. Search takes no filter — use `POST /query` for exact predicates — and it is not cursor-paged: one request returns at most 20 ranked passages. Every result names the exact document version it was cut from, and the `receipt` records that set. `warnings[]` carries the same four kinds as `/context`. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fulltext",
                "hybrid"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 20
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "Who you are serving this answer to. Recorded on the receipt; defaults to the key that made the call."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "description": "The document id this passage came from, when it has one.",
                                "type": "string"
                              },
                              "slug": {
                                "type": "string",
                                "description": "The Brain's own address for the page."
                              },
                              "title": {
                                "type": "string"
                              },
                              "excerpt": {
                                "type": "string"
                              },
                              "rank": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "version": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "slug",
                              "excerpt",
                              "rank",
                              "version"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "fulltext",
                            "hybrid"
                          ]
                        },
                        "staged": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Changes awaiting review. `null` when the count could not be taken."
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "processing",
                                  "access_scoped",
                                  "truncated",
                                  "staged_pending"
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Why this answer is incomplete; empty when it is not."
                        },
                        "receipt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "results",
                        "mode",
                        "staged",
                        "warnings",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/query": {
      "post": {
        "operationId": "BrainV2Read_query",
        "tags": [
          "BrainV2Read"
        ],
        "summary": "Query records",
        "description": "Exact predicates over declared fields. Undeclared values are stored and returned but not filterable until the field is declared. A predicate on an undeclared field, or one whose value does not match the declared type, is a 400 naming the field — never an empty page. A page carries at most 100 records; walk the rest with `nextCursor`. `warnings[]` carries the same four kinds as `/context`. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "kind": {
                    "description": "Omit to query every record, typed or not.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "where": {
                    "description": "Exact field predicates, AND-combined. A scalar is equality; `{ \"has\": \"…\" }` matches one element of a string list.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "has": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "has"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "cursor": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 100
                  },
                  "consumerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "description": "Who you are serving this answer to. Recorded on the receipt; defaults to the key that made the call."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 509,
                                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                              },
                              "kind": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64,
                                "pattern": "^[a-z][a-z0-9_]*$"
                              },
                              "label": {
                                "type": "string"
                              },
                              "fields": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    },
                                    {
                                      "type": "array",
                                      "items": {}
                                    },
                                    {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    }
                                  ]
                                }
                              },
                              "links": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  }
                                }
                              },
                              "sources": {
                                "description": "Document ids that produced these values.",
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "undeclared": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "version": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "fields",
                              "version",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "staged": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Changes awaiting review. `null` when the count could not be taken."
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "processing",
                                  "access_scoped",
                                  "truncated",
                                  "staged_pending"
                                ]
                              },
                              "count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Why this answer is incomplete; empty when it is not."
                        },
                        "receipt": {
                          "type": "string"
                        },
                        "nextCursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "records",
                        "staged",
                        "warnings",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/changes": {
      "get": {
        "operationId": "BrainV2Govern_listChanges",
        "tags": [
          "BrainV2Govern"
        ],
        "summary": "List changes",
        "description": "The review queue when filtered to `staged`. Requires the `review` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `review` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "review",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 250
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "applied",
                "staged",
                "rejected"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "applied",
                                  "staged",
                                  "rejected",
                                  "partially_accepted",
                                  "superseded"
                                ]
                              },
                              "author": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "key"
                                  },
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              "records": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 509,
                                      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                      "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                    },
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 64,
                                      "pattern": "^[a-z][a-z0-9_]*$"
                                    },
                                    "before": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    "after": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "source": {
                                            "type": "string"
                                          },
                                          "quote": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "source",
                                          "quote"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "reason": {
                                "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "status",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "changes"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/changes/{changeId}/approve": {
      "post": {
        "operationId": "BrainV2Govern_approve",
        "tags": [
          "BrainV2Govern"
        ],
        "summary": "Approve a change",
        "description": "Whole, partial, or edited. Attribution is derived from the key that made the call. Requires the `review` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `review` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "review",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "records": {
                    "description": "Approve only these records.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 509,
                      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                      "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                    }
                  },
                  "fields": {
                    "description": "Approve only these fields, per record.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "edits": {
                    "description": "Correct values before accepting; attributed to you.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "before": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "after": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "evidence": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string"
                                        },
                                        "quote": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "quote"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/changes/{changeId}/reject": {
      "post": {
        "operationId": "BrainV2Govern_reject",
        "tags": [
          "BrainV2Govern"
        ],
        "summary": "Reject a change",
        "description": "Records the decision and the reason against the change. Requires the `review` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `review` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "review",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "change": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "applied",
                                "staged",
                                "rejected",
                                "partially_accepted",
                                "superseded"
                              ]
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "key"
                                },
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 509,
                                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                                    "description": "Your id for this record, e.g. `acme` or `crm-account-4471`."
                                  },
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "before": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "after": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  "evidence": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "source": {
                                          "type": "string"
                                        },
                                        "quote": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "source",
                                        "quote"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "reason": {
                              "description": "Why the change is where it is: the reviewer's own reason once it has been settled, the policy reason that staged it while it is waiting.",
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/receipts/{receiptId}": {
      "get": {
        "operationId": "BrainV2Govern_getReceipt",
        "tags": [
          "BrainV2Govern"
        ],
        "summary": "Get a receipt",
        "description": "Pins the exact version of every source a read was shown, so it still resolves after the sources change. Readable only by the key that COMMITTED it — the same key that made the read. A receipt names the credential a read was served under, which is what makes it evidence; another key on the same Brain, and the organization's management key, both get a `404`. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "context",
                                "search",
                                "query"
                              ]
                            },
                            "consumerId": {
                              "type": "string"
                            },
                            "key": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string"
                                  },
                                  "version": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "source",
                                  "version"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "kind",
                            "key",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{handle}/receipts/{receiptId}/now": {
      "get": {
        "operationId": "BrainV2Govern_receiptNow",
        "tags": [
          "BrainV2Govern"
        ],
        "summary": "What changed since a receipt",
        "description": "Answers whether an answer was wrong when it was given or has merely changed since. `changed[]` reports version numbers, not text: `source` and `currentVersion` address what the source says now, through `GET /documents/{id}`. Scoped like `GET /receipts/{id}` — only the key that committed the receipt can reconstruct it. Requires the `read` capability. The organization's `nsk_` management key — as `authorization: Bearer <key>` or as `x-api-key` — carries every capability on every Brain in the organization; a Brain key must list `read` among the capabilities it was minted with and is sent as `authorization: Bearer <secret>`.",
        "x-nicia-brain-capability": "read",
        "security": [
          {
            "apiKey": []
          },
          {
            "brainKey": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$",
              "description": "The handle you chose for this Brain, e.g. `tenant:acme`."
            }
          },
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string"
                              },
                              "shownVersion": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "currentVersion": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "superseded",
                                  "deleted",
                                  "held"
                                ]
                              }
                            },
                            "required": [
                              "source",
                              "shownVersion",
                              "currentVersion",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "unchanged": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "deleted": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changed",
                        "unchanged",
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/artifacts/{artifactId}/extract": {
      "post": {
        "operationId": "BrainArtifactExtraction_extractArtifact",
        "tags": [
          "BrainArtifactExtraction"
        ],
        "summary": "Start statement extraction over a submitted evidence artifact.",
        "description": "Starts an async job against the `artifactId` an earlier `submitEvidence` call returned. Emits `statement` entities ONLY — a verbatim claim, its evidence anchor, and a `derived_from_source` link — never a Brain's own declared kinds (`company`, `person`, …); those enter through `submitMutations`. Poll `artifactExtractionStatus` with the returned `job.id` for the result. Requires the `submit_mutations` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "submit_mutations",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1
                  },
                  "locatorAttachment": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "artifact"
                          },
                          "locator": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "kind",
                          "locator"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "lines"
                          },
                          "locators": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            }
                          }
                        },
                        "required": [
                          "kind",
                          "locators"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "idempotencyKey"
                ]
              },
              "example": {
                "idempotencyKey": "outreach-notes-2026-08-12-extract",
                "locatorAttachment": {
                  "kind": "artifact",
                  "locator": {
                    "source": "customer-crm",
                    "locator": "crm://call/48213"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "artifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "submitting",
                                "admitted",
                                "review_required",
                                "rejected",
                                "no_candidates",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "artifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "candidateCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "rejectedCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "omissions": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "admissionOutcome": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "admitted"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "acceptedSnapshot": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "eventIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    },
                                    "records": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "slug": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          }
                                        },
                                        "required": [
                                          "slug",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "policyVersionId",
                                    "acceptedSnapshot",
                                    "eventIds"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "review_required"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "proposalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "reasons": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "proposalId",
                                    "policyVersionId",
                                    "reasons"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "rejected"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "rejectionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "reasons": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "rejectionId",
                                    "policyVersionId",
                                    "reasons"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "error": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "artifactId",
                            "status",
                            "candidateCount",
                            "rejectedCount",
                            "omissions",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "job": {
                      "id": "018f4b6e-2b1a-7c3e-9d4a-1234567890ab",
                      "knowledgeGraphId": "brain_01J7X1A2BF",
                      "artifactId": "art_01J8Z3M2P0",
                      "status": "scheduled",
                      "candidateCount": 0,
                      "rejectedCount": 0,
                      "omissions": [],
                      "createdAt": "2026-08-12T15:08:00Z",
                      "updatedAt": "2026-08-12T15:08:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/artifacts/{artifactId}/extract/{jobId}": {
      "get": {
        "operationId": "BrainArtifactExtraction_artifactExtractionStatus",
        "tags": [
          "BrainArtifactExtraction"
        ],
        "summary": "Poll an extraction job's status and, once settled, its outcome.",
        "description": "`status` moves scheduled → extracting → submitting → a terminal state (`admitted` | `review_required` | `rejected` | `no_candidates` | `failed` | `cancelled`); `admissionOutcome` is present once the extracted statements were submitted through canonical mutation ingress. Same capability as starting the job — reading a job's outcome is part of owning that write. Requires the `submit_mutations` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "submit_mutations",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "artifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "submitting",
                                "admitted",
                                "review_required",
                                "rejected",
                                "no_candidates",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "artifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "candidateCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "rejectedCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "omissions": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "batchId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "admissionOutcome": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "admitted"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "acceptedSnapshot": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "eventIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    },
                                    "records": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "slug": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "entityKind": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          }
                                        },
                                        "required": [
                                          "slug",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "policyVersionId",
                                    "acceptedSnapshot",
                                    "eventIds"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "review_required"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "proposalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "reasons": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "proposalId",
                                    "policyVersionId",
                                    "reasons"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "rejected"
                                    },
                                    "batchId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "rejectionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "policyVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "reasons": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "batchId",
                                    "rejectionId",
                                    "policyVersionId",
                                    "reasons"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "error": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "artifactId",
                            "status",
                            "candidateCount",
                            "rejectedCount",
                            "omissions",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "job": {
                      "id": "018f4b6e-2b1a-7c3e-9d4a-1234567890ab",
                      "knowledgeGraphId": "brain_01J7X1A2BF",
                      "artifactId": "art_01J8Z3M2P0",
                      "status": "admitted",
                      "artifactVersionId": "artv_01J8Z3M2P1",
                      "candidateCount": 3,
                      "rejectedCount": 0,
                      "omissions": [],
                      "batchId": "batch_01J8Z3U3EF",
                      "admissionOutcome": {
                        "kind": "admitted",
                        "batchId": "batch_01J8Z3U3EF",
                        "policyVersionId": "policyv_01J7X1A2BC",
                        "acceptedSnapshot": "snap_01J8Z3U3EG",
                        "eventIds": [
                          "evt_01J8Z3U3EH"
                        ]
                      },
                      "createdAt": "2026-08-12T15:08:00Z",
                      "updatedAt": "2026-08-12T15:08:20Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections": {
      "post": {
        "operationId": "BrainConnection_create",
        "tags": [
          "BrainConnection"
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "principal": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "user",
                          "service",
                          "agent",
                          "oauth_client"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "kind",
                      "id"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "protocol": {
                    "type": "string",
                    "enum": [
                      "api",
                      "mcp",
                      "cli",
                      "typescript_sdk",
                      "python_sdk"
                    ]
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "environment": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "device": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  },
                  "capabilities": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "query",
                        "request_context",
                        "submit_evidence",
                        "submit_mutations",
                        "review",
                        "policy_admin",
                        "access_admin"
                      ]
                    }
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  }
                },
                "required": [
                  "name",
                  "protocol",
                  "capabilities"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "connection": {
                              "type": "object",
                              "properties": {
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "principal": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "user",
                                        "service",
                                        "agent",
                                        "oauth_client"
                                      ]
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "protocol": {
                                  "type": "string",
                                  "enum": [
                                    "api",
                                    "mcp",
                                    "cli",
                                    "typescript_sdk",
                                    "python_sdk"
                                  ]
                                },
                                "client": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "environment": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "device": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "paused",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastActivityAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "connectionId",
                                "scope",
                                "principal",
                                "name",
                                "protocol",
                                "capabilities",
                                "status",
                                "generation",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "credentialGrant": {
                              "type": "object",
                              "properties": {
                                "credentialGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "api_key"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "predecessorGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "credentialGrantId",
                                "connectionId",
                                "scope",
                                "capabilities",
                                "kind",
                                "status",
                                "generation",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "credential": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "connection",
                            "credentialGrant",
                            "credential"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "connection": {
                              "type": "object",
                              "properties": {
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "principal": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "user",
                                        "service",
                                        "agent",
                                        "oauth_client"
                                      ]
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "protocol": {
                                  "type": "string",
                                  "enum": [
                                    "api",
                                    "mcp",
                                    "cli",
                                    "typescript_sdk",
                                    "python_sdk"
                                  ]
                                },
                                "client": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "environment": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "device": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "paused",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastActivityAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "connectionId",
                                "scope",
                                "principal",
                                "name",
                                "protocol",
                                "capabilities",
                                "status",
                                "generation",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "credentialGrant": {
                              "type": "object",
                              "properties": {
                                "credentialGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "api_key"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "predecessorGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "credentialGrantId",
                                "connectionId",
                                "scope",
                                "capabilities",
                                "kind",
                                "status",
                                "generation",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "credentialAlreadyIssued": {
                              "type": "boolean",
                              "const": true
                            }
                          },
                          "required": [
                            "connection",
                            "credentialGrant",
                            "credentialAlreadyIssued"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainConnection_list",
        "tags": [
          "BrainConnection"
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 250
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "paused",
                "revoked",
                "expired"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connections": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "scope": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "brain"
                                  },
                                  "brainId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "brainGeneration": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "kind",
                                  "brainId",
                                  "brainGeneration"
                                ],
                                "additionalProperties": false
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "protocol": {
                                "type": "string",
                                "enum": [
                                  "api",
                                  "mcp",
                                  "cli",
                                  "typescript_sdk",
                                  "python_sdk"
                                ]
                              },
                              "client": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "environment": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "device": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind"
                                ],
                                "additionalProperties": false
                              },
                              "capabilities": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "read",
                                    "query",
                                    "request_context",
                                    "submit_evidence",
                                    "submit_mutations",
                                    "review",
                                    "policy_admin",
                                    "access_admin"
                                  ]
                                }
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "revoked",
                                  "expired"
                                ]
                              },
                              "generation": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "revokedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "lastAuthenticatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "lastActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "connectionId",
                              "scope",
                              "principal",
                              "name",
                              "protocol",
                              "capabilities",
                              "status",
                              "generation",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "connections"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/handshake": {
      "post": {
        "operationId": "BrainConnection_verifyHandshake",
        "tags": [
          "BrainConnection"
        ],
        "summary": "Verify this Connection credential and read its authority.",
        "description": "The only Brain Connection operation that requires NO capability of its own: any credential live for this Brain Connection may call it, presented as `Authorization: Bearer <credential>` (the org API key is still rejected). Self-verification necessarily precedes knowing what the credential can do, so the capability to check is an INPUT — the body's `requiredCapability` — not a fixed property of the operation; the call fails with 409 `conflict` when the credential does not carry the one named. Start here to confirm which capabilities a credential actually carries: the response's `authority.effectiveCapabilities` is the intersection of the Connection's capabilities and the credential grant's, which is what every other operation's capability gate is checked against.",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "requiredCapability": {
                    "type": "string",
                    "enum": [
                      "read",
                      "query",
                      "request_context",
                      "submit_evidence",
                      "submit_mutations",
                      "review",
                      "policy_admin",
                      "access_admin"
                    ]
                  }
                },
                "required": [
                  "requiredCapability"
                ]
              },
              "example": {
                "requiredCapability": "query"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "authority": {
                          "type": "object",
                          "properties": {
                            "connection": {
                              "type": "object",
                              "properties": {
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "principal": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "user",
                                        "service",
                                        "agent",
                                        "oauth_client"
                                      ]
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "protocol": {
                                  "type": "string",
                                  "enum": [
                                    "api",
                                    "mcp",
                                    "cli",
                                    "typescript_sdk",
                                    "python_sdk"
                                  ]
                                },
                                "client": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "environment": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "device": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "paused",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastActivityAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "connectionId",
                                "scope",
                                "principal",
                                "name",
                                "protocol",
                                "capabilities",
                                "status",
                                "generation",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "credentialGrant": {
                              "type": "object",
                              "properties": {
                                "credentialGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "connectionId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "scope": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "brain"
                                    },
                                    "brainId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "brainGeneration": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "brainId",
                                    "brainGeneration"
                                  ],
                                  "additionalProperties": false
                                },
                                "capabilities": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "read",
                                      "query",
                                      "request_context",
                                      "submit_evidence",
                                      "submit_mutations",
                                      "review",
                                      "policy_admin",
                                      "access_admin"
                                    ]
                                  }
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "api_key"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "revoked",
                                    "expired"
                                  ]
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "predecessorGrantId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "revokedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "lastAuthenticatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "credentialGrantId",
                                "connectionId",
                                "scope",
                                "capabilities",
                                "kind",
                                "status",
                                "generation",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "brain": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "brainId",
                                "generation"
                              ],
                              "additionalProperties": false
                            },
                            "effectiveCapabilities": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "query",
                                  "request_context",
                                  "submit_evidence",
                                  "submit_mutations",
                                  "review",
                                  "policy_admin",
                                  "access_admin"
                                ]
                              }
                            },
                            "authenticatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "connection",
                            "credentialGrant",
                            "brain",
                            "effectiveCapabilities",
                            "authenticatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "authority"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/rotate": {
      "post": {
        "operationId": "BrainConnection_rotate",
        "tags": [
          "BrainConnection"
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  "capabilities": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "query",
                        "request_context",
                        "submit_evidence",
                        "submit_mutations",
                        "review",
                        "policy_admin",
                        "access_admin"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connection": {
                          "type": "object",
                          "properties": {
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "scope": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "brain"
                                },
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "brainGeneration": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "kind",
                                "brainId",
                                "brainGeneration"
                              ],
                              "additionalProperties": false
                            },
                            "principal": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "service",
                                    "agent",
                                    "oauth_client"
                                  ]
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "kind",
                                "id"
                              ],
                              "additionalProperties": false
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "protocol": {
                              "type": "string",
                              "enum": [
                                "api",
                                "mcp",
                                "cli",
                                "typescript_sdk",
                                "python_sdk"
                              ]
                            },
                            "client": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "environment": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "device": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            "capabilities": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "query",
                                  "request_context",
                                  "submit_evidence",
                                  "submit_mutations",
                                  "review",
                                  "policy_admin",
                                  "access_admin"
                                ]
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "revoked",
                                "expired"
                              ]
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "revokedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "lastAuthenticatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "connectionId",
                            "scope",
                            "principal",
                            "name",
                            "protocol",
                            "capabilities",
                            "status",
                            "generation",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "credentialGrant": {
                          "type": "object",
                          "properties": {
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "scope": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "brain"
                                },
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "brainGeneration": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "kind",
                                "brainId",
                                "brainGeneration"
                              ],
                              "additionalProperties": false
                            },
                            "capabilities": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "query",
                                  "request_context",
                                  "submit_evidence",
                                  "submit_mutations",
                                  "review",
                                  "policy_admin",
                                  "access_admin"
                                ]
                              }
                            },
                            "kind": {
                              "type": "string",
                              "const": "api_key"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "revoked",
                                "expired"
                              ]
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "predecessorGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "revokedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "lastAuthenticatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "credentialGrantId",
                            "connectionId",
                            "scope",
                            "capabilities",
                            "kind",
                            "status",
                            "generation",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "credential": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "connection",
                        "credentialGrant",
                        "credential"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/revoke": {
      "post": {
        "operationId": "BrainConnection_revoke",
        "tags": [
          "BrainConnection"
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connection": {
                          "type": "object",
                          "properties": {
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "scope": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "brain"
                                },
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "brainGeneration": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "kind",
                                "brainId",
                                "brainGeneration"
                              ],
                              "additionalProperties": false
                            },
                            "principal": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "service",
                                    "agent",
                                    "oauth_client"
                                  ]
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "kind",
                                "id"
                              ],
                              "additionalProperties": false
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "protocol": {
                              "type": "string",
                              "enum": [
                                "api",
                                "mcp",
                                "cli",
                                "typescript_sdk",
                                "python_sdk"
                              ]
                            },
                            "client": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "environment": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "device": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            },
                            "capabilities": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "query",
                                  "request_context",
                                  "submit_evidence",
                                  "submit_mutations",
                                  "review",
                                  "policy_admin",
                                  "access_admin"
                                ]
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "revoked",
                                "expired"
                              ]
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "revokedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "lastAuthenticatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "connectionId",
                            "scope",
                            "principal",
                            "name",
                            "protocol",
                            "capabilities",
                            "status",
                            "generation",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "connection"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/webhooks": {
      "post": {
        "operationId": "BrainConnectionWebhook_create",
        "tags": [
          "BrainConnectionWebhook"
        ],
        "summary": "Subscribe this Connection to its own async completion events.",
        "description": "Only the three narrow event types this Connection's own operations can raise (`extraction.completed`, `review.settled`, `batch.admitted`) — never Brain-wide or tenant-wide events; use `/v1/webhooks` for those. The response's `secret` (HMAC signing key for delivered payloads) is shown ONCE. Requires the `access_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP. Registration authority is coupled to the producing credential: an external producer subscribing to hear about its own jobs must carry `access_admin`, even if admin operations are otherwise hidden from its model tools.",
        "x-nicia-capability": "access_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "extraction.completed",
                        "review.settled",
                        "batch.admitted"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              },
              "example": {
                "url": "https://outreach.example.com/webhooks/nicia",
                "events": [
                  "batch.admitted",
                  "review.settled"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "webhook": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "url": {
                              "type": "string"
                            },
                            "secret": {
                              "type": "string"
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "extraction.completed",
                                  "review.settled",
                                  "batch.admitted"
                                ]
                              }
                            },
                            "active": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "connectionId",
                            "url",
                            "events",
                            "active",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "webhook"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "webhook": {
                      "id": "webhook_01J8Z3V4GH",
                      "connectionId": "conn_01J7X1A2BD",
                      "url": "https://outreach.example.com/webhooks/nicia",
                      "secret": "whsec_9f2c1a7e4b6d8f0e2c4a6b8d0f2e4c6a",
                      "events": [
                        "batch.admitted",
                        "review.settled"
                      ],
                      "active": true,
                      "createdAt": "2026-08-12T15:09:00Z",
                      "updatedAt": "2026-08-12T15:09:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainConnectionWebhook_list",
        "tags": [
          "BrainConnectionWebhook"
        ],
        "summary": "List this Connection's webhook subscriptions.",
        "description": "`secret` is never re-shown here — only on the `create` response. Requires the `access_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "access_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "webhooks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "url": {
                                "type": "string"
                              },
                              "secret": {
                                "type": "string"
                              },
                              "events": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "extraction.completed",
                                    "review.settled",
                                    "batch.admitted"
                                  ]
                                }
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "connectionId",
                              "url",
                              "events",
                              "active",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "webhooks"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "webhooks": [
                      {
                        "id": "webhook_01J8Z3V4GH",
                        "connectionId": "conn_01J7X1A2BD",
                        "url": "https://outreach.example.com/webhooks/nicia",
                        "events": [
                          "batch.admitted",
                          "review.settled"
                        ],
                        "active": true,
                        "createdAt": "2026-08-12T15:09:00Z",
                        "updatedAt": "2026-08-12T15:09:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/webhooks/{webhookId}": {
      "delete": {
        "operationId": "BrainConnectionWebhook_remove",
        "tags": [
          "BrainConnectionWebhook"
        ],
        "summary": "Unsubscribe a webhook.",
        "description": "An unknown `webhookId`, or one belonging to a DIFFERENT Connection, returns 404 `not_found` — the two are answered identically, so this route never confirms another Connection's webhook ids. Not idempotent on repeat delete: the second call against the same id 404s. Requires the `access_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "access_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "deleted": true
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/export": {
      "post": {
        "operationId": "BrainExport_start",
        "tags": [
          "BrainExport"
        ],
        "summary": "Start a full-Brain export job.",
        "description": "Async — 202 with a `queued`/`running` job; poll `status` for completion, then download from `downloadPath` (a raw route, not part of this JSON contract). 409 if a job is already running for this Connection. Includes originals, Markdown, typed records, evidence refs/anchors, and complete revision history as a Knowledge Bundle `.zip` — canonical read-receipt records and the external operation ledger are NOT included; exported receipt/operation ids are locators, not independently verifiable provenance after migration. Requires the `access_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP. A bulk export exfiltrates the WHOLE Brain — every historical revision, every typed field, every evidence anchor — materially more sensitive than an ordinary receipted read or query, so it reuses the same administrative gate as the Connection admin plane rather than `read`/`query`.",
        "x-nicia-capability": "access_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "brainId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "error": {
                              "type": "string"
                            },
                            "manifestRootHash": {
                              "type": "string",
                              "minLength": 1
                            },
                            "byteLength": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "documentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "evidenceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "historyEntryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "downloadPath": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "startedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "completedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "brainId",
                            "connectionId",
                            "status",
                            "documentCount",
                            "recordCount",
                            "evidenceCount",
                            "historyEntryCount",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "job": {
                      "id": "export_01J8Z3W5HI",
                      "brainId": "brain_01J7X1A2BF",
                      "connectionId": "conn_01J7X1A2BJ",
                      "status": "queued",
                      "documentCount": 0,
                      "recordCount": 0,
                      "evidenceCount": 0,
                      "historyEntryCount": 0,
                      "createdAt": "2026-08-12T15:10:00Z",
                      "updatedAt": "2026-08-12T15:10:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "BrainExport_status",
        "tags": [
          "BrainExport"
        ],
        "summary": "Poll this Connection's most recent export job.",
        "description": "Always the LATEST job for this Connection — there is no job-id path parameter, since only one export runs at a time per Connection. `downloadPath` appears once `status` is `completed`. Requires the `access_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "access_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "brainId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "queued",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "error": {
                              "type": "string"
                            },
                            "manifestRootHash": {
                              "type": "string",
                              "minLength": 1
                            },
                            "byteLength": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "documentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "recordCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "evidenceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "historyEntryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "downloadPath": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "startedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "completedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "brainId",
                            "connectionId",
                            "status",
                            "documentCount",
                            "recordCount",
                            "evidenceCount",
                            "historyEntryCount",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "job": {
                      "id": "export_01J8Z3W5HI",
                      "brainId": "brain_01J7X1A2BF",
                      "connectionId": "conn_01J7X1A2BJ",
                      "status": "completed",
                      "manifestRootHash": "sha256:4a6c8e0f2d4b6a8c0e2f4a6c8e0f2d4b",
                      "byteLength": 4213504,
                      "documentCount": 42,
                      "recordCount": 118,
                      "evidenceCount": 9,
                      "historyEntryCount": 203,
                      "downloadPath": "/v1/brains/brain_01J7X1A2BF/connections/conn_01J7X1A2BJ/export/export_01J8Z3W5HI/download",
                      "createdAt": "2026-08-12T15:10:00Z",
                      "updatedAt": "2026-08-12T15:11:30Z",
                      "startedAt": "2026-08-12T15:10:02Z",
                      "completedAt": "2026-08-12T15:11:30Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/policies/current": {
      "get": {
        "operationId": "BrainPolicyPlane_getCurrent",
        "tags": [
          "BrainPolicyPlane"
        ],
        "summary": "Fetch the Brain's currently active admission policy.",
        "description": "The shipped v1 policy has one Brain-global `defaultOutcome` (`admit` | `review` | `reject`) — it applies to every submitted batch as a whole; there is no per-Connection or per-mutation-kind override yet. Requires the `policy_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "policy_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "expectedGeneration",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "policyVersionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "proposed",
                            "active",
                            "superseded"
                          ]
                        },
                        "rules": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "activatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "policyVersionId",
                        "version",
                        "status",
                        "rules",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "policyVersionId": "policyv_01J7X1A2BC",
                    "version": "1",
                    "status": "active",
                    "rules": {
                      "schemaVersion": "v1",
                      "defaultOutcome": "admit",
                      "reasons": []
                    },
                    "createdAt": "2026-08-01T09:00:00Z",
                    "activatedAt": "2026-08-01T09:00:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/policies": {
      "get": {
        "operationId": "BrainPolicyPlane_listVersions",
        "tags": [
          "BrainPolicyPlane"
        ],
        "summary": "Page through every policy version this Brain has had.",
        "description": "History of `proposed`/`active`/`superseded` policy versions, newest first. Cursor-paginated. Requires the `policy_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "policy_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "expectedGeneration",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 250
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "policyVersionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "version": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "active",
                                  "superseded"
                                ]
                              },
                              "rules": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "activatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "policyVersionId",
                              "version",
                              "status",
                              "rules",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "policyVersionId": "policyv_01J7X1A2BC",
                        "version": "1",
                        "status": "active",
                        "rules": {
                          "schemaVersion": "v1",
                          "defaultOutcome": "admit",
                          "reasons": []
                        },
                        "createdAt": "2026-08-01T09:00:00Z",
                        "activatedAt": "2026-08-01T09:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/policies/activate": {
      "post": {
        "operationId": "BrainPolicyPlane_activate",
        "tags": [
          "BrainPolicyPlane"
        ],
        "summary": "Replace the Brain's active admission policy.",
        "description": "`expectedActivePolicyVersionId` is an exact-base guard — the same optimistic-concurrency shape as a mutation batch's `expectedGeneration`, so two concurrent policy edits cannot silently clobber each other. Rejecting a `defaultOutcome: admit` rule that also carries `reasons` (or the reverse) is enforced server-side. Requires the `policy_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "policy_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedActivePolicyVersionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "rules": {
                    "type": "object",
                    "properties": {
                      "schemaVersion": {
                        "type": "string",
                        "const": "v1"
                      },
                      "defaultOutcome": {
                        "type": "string",
                        "enum": [
                          "admit",
                          "review",
                          "reject"
                        ]
                      },
                      "reasons": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "required": [
                      "schemaVersion",
                      "defaultOutcome",
                      "reasons"
                    ]
                  }
                },
                "required": [
                  "expectedGeneration",
                  "expectedActivePolicyVersionId",
                  "rules"
                ],
                "additionalProperties": false
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "expectedActivePolicyVersionId": "policyv_01J7X1A2BC",
                "rules": {
                  "schemaVersion": "v1",
                  "defaultOutcome": "review",
                  "reasons": [
                    "low_confidence_inference"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "policyVersionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "proposed",
                            "active",
                            "superseded"
                          ]
                        },
                        "rules": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "activatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "policyVersionId",
                        "version",
                        "status",
                        "rules",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "policyVersionId": "policyv_01J8Z3S1AB",
                    "version": "2",
                    "status": "active",
                    "rules": {
                      "schemaVersion": "v1",
                      "defaultOutcome": "review",
                      "reasons": [
                        "low_confidence_inference"
                      ]
                    },
                    "createdAt": "2026-08-01T09:00:00Z",
                    "activatedAt": "2026-08-01T09:00:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/policies/explain": {
      "post": {
        "operationId": "BrainPolicyPlane_explain",
        "tags": [
          "BrainPolicyPlane"
        ],
        "summary": "Dry-run the active policy against a candidate mutation set.",
        "description": "Predicts `admitted` | `review_required` | `rejected` for the given `mutations` WITHOUT submitting them — lets an integrator preview the outcome before spending a real `idempotencyKey` on `submitMutations`. Requires the `policy_admin` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "policy_admin",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "policyVersionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "mutations": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "create_entity"
                            },
                            "entityKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fields": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "entityKind",
                            "fields"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "delete_entity"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "set_field"
                            },
                            "field": {
                              "type": "string",
                              "minLength": 1
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "field"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "retype_entity"
                            },
                            "fromKind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toKind": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "fromKind",
                            "toKind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "link"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "unlink"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "toTarget": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "edge",
                            "toTarget"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "target": {
                              "type": "object",
                              "properties": {
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "entityKind",
                                "slug"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseArtifactVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "const": "edit_body"
                            },
                            "proposedBody": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "target",
                            "provenance",
                            "kind",
                            "proposedBody"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "evolve_schema"
                            },
                            "schemaSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "delta": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "impact": {
                              "type": "object",
                              "properties": {
                                "entitiesAffected": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "fieldsLost": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "entitiesAffected",
                                "fieldsLost"
                              ]
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "actor": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "human"
                                        },
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "userId"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "agent"
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "runId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "agentId"
                                      ]
                                    }
                                  ]
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "emitted",
                                    "derived"
                                  ]
                                },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                }
                              },
                              "required": [
                                "actor",
                                "origin"
                              ]
                            },
                            "baseSchemaVersion": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "kind",
                            "schemaSlug",
                            "delta",
                            "impact",
                            "provenance"
                          ]
                        }
                      ]
                    }
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "credentialGrantId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "principal": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "user",
                              "service",
                              "agent",
                              "oauth_client"
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        },
                        "required": [
                          "kind",
                          "id"
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "human",
                          "agent",
                          "pipeline",
                          "propagation",
                          "system"
                        ]
                      },
                      "evidence": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "evidenceId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "anchor": {
                              "type": "object",
                              "properties": {
                                "locator": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "fragmentHash": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "quote": {
                                  "type": "string",
                                  "maxLength": 65536
                                }
                              },
                              "required": [
                                "locator",
                                "fragmentHash"
                              ]
                            }
                          },
                          "required": [
                            "evidenceId",
                            "versionId",
                            "contentHash"
                          ]
                        }
                      },
                      "intent": {
                        "type": "string",
                        "minLength": 1
                      },
                      "confidence": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "causingRunId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "parentChangeSetId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "connectionId",
                      "credentialGrantId",
                      "principal",
                      "origin",
                      "evidence"
                    ]
                  },
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "mutations",
                  "provenance",
                  "expectedGeneration"
                ],
                "additionalProperties": false
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "mutations": [
                  {
                    "kind": "create_entity",
                    "target": {
                      "entityKind": "person",
                      "slug": "bob-smith-project-y"
                    },
                    "entityKind": "person",
                    "fields": {
                      "name": "Bob Smith"
                    },
                    "provenance": {
                      "actor": {
                        "kind": "agent",
                        "agentId": "company-os-outreach-agent"
                      },
                      "origin": "emitted"
                    }
                  }
                ],
                "provenance": {
                  "actor": {
                    "kind": "agent",
                    "agentId": "company-os-outreach-agent"
                  },
                  "origin": "emitted"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "policyVersionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "predictedOutcome": {
                          "type": "string",
                          "enum": [
                            "admitted",
                            "review_required",
                            "rejected"
                          ]
                        },
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          }
                        }
                      },
                      "required": [
                        "policyVersionId",
                        "predictedOutcome",
                        "reasons"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "policyVersionId": "policyv_01J7X1A2BC",
                    "predictedOutcome": "admitted",
                    "reasons": []
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals": {
      "get": {
        "operationId": "BrainReviewPlane_listProposals",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Page through this Brain's staged review proposals.",
        "description": "Every proposal policy sent to review, filterable by `state` (`pending` by default in most reviewer UIs, but the API returns all states unless filtered). Cursor-paginated. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "partially_accepted",
                "accepted",
                "rejected",
                "superseded"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 250
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "pending",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals/{proposalId}": {
      "get": {
        "operationId": "BrainReviewPlane_getProposal",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Fetch one staged proposal, item by item.",
        "description": "Each `items[]` entry carries its own `mutations` and per-item `mutationDecisions` — a reviewer can approve, reject, or supersede at the item level as well as the whole proposal. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "brainId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "brainGeneration": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "partially_accepted",
                            "accepted",
                            "rejected",
                            "superseded"
                          ]
                        },
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "decisionReason": {
                          "type": "string"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "batchId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "producingRunId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            }
                          },
                          "additionalProperties": false
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "applied",
                                  "rejected",
                                  "failed",
                                  "reverted"
                                ]
                              },
                              "entityKind": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "mutations": {
                                "type": "array",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "create_entity"
                                        },
                                        "entityKind": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "fields": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              }
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "entityKind",
                                        "fields"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "delete_entity"
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "set_field"
                                        },
                                        "field": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "field"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "retype_entity"
                                        },
                                        "fromKind": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toKind": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "fromKind",
                                        "toKind"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "link"
                                        },
                                        "edge": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toTarget": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "edge",
                                        "toTarget"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "unlink"
                                        },
                                        "edge": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toTarget": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "edge",
                                        "toTarget"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "target": {
                                          "type": "object",
                                          "properties": {
                                            "entityKind": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "slug": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "entityKind",
                                            "slug"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseArtifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "kind": {
                                          "type": "string",
                                          "const": "edit_body"
                                        },
                                        "proposedBody": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "target",
                                        "provenance",
                                        "kind",
                                        "proposedBody"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "evolve_schema"
                                        },
                                        "schemaSlug": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "delta": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {}
                                        },
                                        "impact": {
                                          "type": "object",
                                          "properties": {
                                            "entitiesAffected": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "fieldsLost": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          },
                                          "required": [
                                            "entitiesAffected",
                                            "fieldsLost"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "provenance": {
                                          "type": "object",
                                          "properties": {
                                            "actor": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "human"
                                                    },
                                                    "userId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "userId"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "agent"
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "agentId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "origin": {
                                              "type": "string",
                                              "enum": [
                                                "emitted",
                                                "derived"
                                              ]
                                            },
                                            "source": {
                                              "type": "object",
                                              "properties": {
                                                "documentId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "passage": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "quote": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "actor",
                                            "origin"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "baseSchemaVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "schemaSlug",
                                        "delta",
                                        "impact",
                                        "provenance"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "mutationDecisions": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "accepted",
                                    "rejected"
                                  ]
                                }
                              },
                              "evidence": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "documentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "passage": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "quote": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "evidenceRefs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "evidenceId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "versionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "contentHash": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "anchor": {
                                      "type": "object",
                                      "properties": {
                                        "locator": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string"
                                          },
                                          "additionalProperties": {}
                                        },
                                        "fragmentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "quote": {
                                          "type": "string",
                                          "maxLength": 65536
                                        }
                                      },
                                      "required": [
                                        "locator",
                                        "fragmentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "evidenceId",
                                    "versionId",
                                    "contentHash"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "baseArtifactVersionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "correctsEventId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "justification": {
                                "type": "string"
                              },
                              "failureReason": {
                                "type": "string"
                              },
                              "contendingProposalIds": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                }
                              }
                            },
                            "required": [
                              "itemId",
                              "state",
                              "mutations",
                              "mutationDecisions",
                              "evidence",
                              "evidenceRefs",
                              "contendingProposalIds"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "supersededByProposalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "decidedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "proposalId",
                        "brainId",
                        "brainGeneration",
                        "state",
                        "reasons",
                        "provenance",
                        "items",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposalId": "proposal_01J8Z3R2WX",
                    "brainId": "brain_01J7X1A2BF",
                    "brainGeneration": "gen_01J8Z3K7QW",
                    "state": "pending",
                    "reasons": [
                      "low_confidence_inference"
                    ],
                    "provenance": {
                      "connectionId": "conn_01J7X1A2BI"
                    },
                    "items": [
                      {
                        "itemId": "item_01J8Z3R2WY",
                        "state": "pending",
                        "entityKind": "lead",
                        "slug": "bob-smith-project-y-lead",
                        "mutations": [
                          {
                            "kind": "set_field",
                            "target": {
                              "entityKind": "lead",
                              "slug": "bob-smith-project-y-lead"
                            },
                            "field": "stage",
                            "value": "qualified",
                            "provenance": {
                              "actor": {
                                "kind": "agent",
                                "agentId": "company-os-outreach-agent"
                              },
                              "origin": "derived"
                            }
                          }
                        ],
                        "mutationDecisions": [
                          "pending"
                        ],
                        "evidence": []
                      }
                    ],
                    "createdAt": "2026-08-12T15:10:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals/{proposalId}/approve": {
      "post": {
        "operationId": "BrainReviewPlane_approve",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Accept a staged proposal as-is (whole, or by item).",
        "description": "Omit `itemDecisions` to accept every item; supply it to accept a subset (unlisted items stay pending). The response's `decisions[]` records the attributable reviewer principal — this is how Review settlement names an external human, not just a Connection. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP. The API-key `principal` on the credential's grant becomes the decision's attributed principal.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "itemDecisions": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "decision": {
                          "type": "string",
                          "enum": [
                            "accepted",
                            "rejected"
                          ]
                        },
                        "reason": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "mutationDecisions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mutationIndex": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "required": [
                              "mutationIndex",
                              "decision"
                            ]
                          }
                        }
                      },
                      "required": [
                        "itemId",
                        "decision"
                      ]
                    }
                  }
                },
                "required": [
                  "expectedGeneration"
                ]
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "decisions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "decisionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "verb": {
                                "type": "string",
                                "enum": [
                                  "approve",
                                  "edit_and_approve",
                                  "reject",
                                  "supersede",
                                  "resolve_contradiction"
                                ]
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contendingProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "resolutionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "decisionId",
                              "proposalId",
                              "verb",
                              "decision",
                              "reasons",
                              "connectionId",
                              "credentialGrantId",
                              "principal",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "applied": {
                          "type": "object",
                          "properties": {
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "acceptedSnapshot",
                            "records"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "proposals",
                        "decisions"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposals": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "accepted",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z"
                      }
                    ],
                    "decisions": [
                      {
                        "decisionId": "decision_01J8Z3R4YZ",
                        "proposalId": "proposal_01J8Z3R2WX",
                        "verb": "approve",
                        "decision": "accepted",
                        "reasons": [],
                        "connectionId": "conn_01J7X1A2BJ",
                        "credentialGrantId": "cred_01J7X1A2BK",
                        "principal": {
                          "kind": "user",
                          "id": "user_01J7X1A2BH"
                        },
                        "decidedAt": "2026-08-12T15:11:00Z"
                      }
                    ],
                    "applied": {
                      "acceptedSnapshot": "snap_01J8Z3R500",
                      "records": [
                        {
                          "slug": "bob-smith-project-y-lead",
                          "entityKind": "lead",
                          "artifactVersionId": "artv_01J8Z3R501"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals/{proposalId}/edit-and-approve": {
      "post": {
        "operationId": "BrainReviewPlane_editAndApprove",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Amend one or more staged mutations, then approve.",
        "description": "`edits` replaces named mutations' payloads before admission; the amended mutation re-validates through the same canonical validation the original batch went through. `reason` is required — an edit always states why the staged write was not accepted as submitted. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "edits": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "mutationIndex": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "mutation": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "create_entity"
                                },
                                "entityKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "fields": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "entityKind",
                                "fields"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "delete_entity"
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "set_field"
                                },
                                "field": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "field"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "retype_entity"
                                },
                                "fromKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "toKind": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "fromKind",
                                "toKind"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "link"
                                },
                                "edge": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "toTarget": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "edge",
                                "toTarget"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "unlink"
                                },
                                "edge": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "toTarget": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "edge",
                                "toTarget"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "target": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "entityKind",
                                    "slug"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseArtifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "edit_body"
                                },
                                "proposedBody": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "target",
                                "provenance",
                                "kind",
                                "proposedBody"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "evolve_schema"
                                },
                                "schemaSlug": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "delta": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "impact": {
                                  "type": "object",
                                  "properties": {
                                    "entitiesAffected": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "fieldsLost": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "entitiesAffected",
                                    "fieldsLost"
                                  ]
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "actor": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "human"
                                            },
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "userId"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "agent"
                                            },
                                            "agentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "agentId"
                                          ]
                                        }
                                      ]
                                    },
                                    "origin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "source": {
                                      "type": "object",
                                      "properties": {
                                        "documentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "passage": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "quote": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      }
                                    }
                                  },
                                  "required": [
                                    "actor",
                                    "origin"
                                  ]
                                },
                                "baseSchemaVersion": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "kind",
                                "schemaSlug",
                                "delta",
                                "impact",
                                "provenance"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "itemId",
                        "mutationIndex",
                        "mutation"
                      ]
                    }
                  },
                  "itemDecisions": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "decision": {
                          "type": "string",
                          "enum": [
                            "accepted",
                            "rejected"
                          ]
                        },
                        "reason": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "mutationDecisions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mutationIndex": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "required": [
                              "mutationIndex",
                              "decision"
                            ]
                          }
                        }
                      },
                      "required": [
                        "itemId",
                        "decision"
                      ]
                    }
                  }
                },
                "required": [
                  "expectedGeneration",
                  "reason",
                  "edits"
                ]
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "reason": "Corrected stage to match the call outcome.",
                "edits": [
                  {
                    "itemId": "item_01J8Z3R2WY",
                    "mutationIndex": 0,
                    "mutation": {
                      "kind": "set_field",
                      "target": {
                        "entityKind": "lead",
                        "slug": "bob-smith-project-y-lead"
                      },
                      "field": "stage",
                      "value": "meeting_scheduled",
                      "provenance": {
                        "actor": {
                          "kind": "human",
                          "userId": "user_01J7X1A2BH"
                        },
                        "origin": "emitted"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "decisions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "decisionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "verb": {
                                "type": "string",
                                "enum": [
                                  "approve",
                                  "edit_and_approve",
                                  "reject",
                                  "supersede",
                                  "resolve_contradiction"
                                ]
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contendingProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "resolutionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "decisionId",
                              "proposalId",
                              "verb",
                              "decision",
                              "reasons",
                              "connectionId",
                              "credentialGrantId",
                              "principal",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "applied": {
                          "type": "object",
                          "properties": {
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "acceptedSnapshot",
                            "records"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "proposals",
                        "decisions"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposals": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "accepted",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z"
                      }
                    ],
                    "decisions": [
                      {
                        "decisionId": "decision_01J8Z3R4YZ",
                        "proposalId": "proposal_01J8Z3R2WX",
                        "verb": "approve",
                        "decision": "accepted",
                        "reasons": [],
                        "connectionId": "conn_01J7X1A2BJ",
                        "credentialGrantId": "cred_01J7X1A2BK",
                        "principal": {
                          "kind": "user",
                          "id": "user_01J7X1A2BH"
                        },
                        "decidedAt": "2026-08-12T15:11:00Z"
                      }
                    ],
                    "applied": {
                      "acceptedSnapshot": "snap_01J8Z3R500",
                      "records": [
                        {
                          "slug": "bob-smith-project-y-lead",
                          "entityKind": "lead",
                          "artifactVersionId": "artv_01J8Z3R501"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals/{proposalId}/reject": {
      "post": {
        "operationId": "BrainReviewPlane_reject",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Reject a staged proposal, whole or by item.",
        "description": "`reasons` is required and non-empty. Omit `itemIds` to reject the whole proposal; supply it for a per-item veto (unlisted items stay pending). Nothing here writes to the Brain — a rejected proposal leaves no trace on canonical state. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "reasons": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048
                    }
                  },
                  "itemIds": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    }
                  }
                },
                "required": [
                  "expectedGeneration",
                  "reasons"
                ]
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "reasons": [
                  "Not enough signal to confirm the stage change."
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "decisions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "decisionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "verb": {
                                "type": "string",
                                "enum": [
                                  "approve",
                                  "edit_and_approve",
                                  "reject",
                                  "supersede",
                                  "resolve_contradiction"
                                ]
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contendingProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "resolutionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "decisionId",
                              "proposalId",
                              "verb",
                              "decision",
                              "reasons",
                              "connectionId",
                              "credentialGrantId",
                              "principal",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "applied": {
                          "type": "object",
                          "properties": {
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "acceptedSnapshot",
                            "records"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "proposals",
                        "decisions"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposals": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "rejected",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z"
                      }
                    ],
                    "decisions": [
                      {
                        "decisionId": "decision_01J8Z3R4YZ",
                        "proposalId": "proposal_01J8Z3R2WX",
                        "verb": "reject",
                        "decision": "rejected",
                        "reasons": [
                          "Not enough signal to confirm the stage change."
                        ],
                        "connectionId": "conn_01J7X1A2BJ",
                        "credentialGrantId": "cred_01J7X1A2BK",
                        "principal": {
                          "kind": "user",
                          "id": "user_01J7X1A2BH"
                        },
                        "decidedAt": "2026-08-12T15:11:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/proposals/{proposalId}/supersede": {
      "post": {
        "operationId": "BrainReviewPlane_supersede",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Mark a stale proposal superseded by a newer one.",
        "description": "For when a later batch already covers what this proposal staged — closes it out with a pointer to `supersedingProposalId` instead of an approve/reject decision on content that is now moot. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "supersedingProposalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "reasons": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048
                    }
                  }
                },
                "required": [
                  "expectedGeneration",
                  "supersedingProposalId",
                  "reasons"
                ]
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "supersedingProposalId": "proposal_01J8Z3R900",
                "reasons": [
                  "A newer batch already covers this stage change."
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "decisions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "decisionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "verb": {
                                "type": "string",
                                "enum": [
                                  "approve",
                                  "edit_and_approve",
                                  "reject",
                                  "supersede",
                                  "resolve_contradiction"
                                ]
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contendingProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "resolutionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "decisionId",
                              "proposalId",
                              "verb",
                              "decision",
                              "reasons",
                              "connectionId",
                              "credentialGrantId",
                              "principal",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "applied": {
                          "type": "object",
                          "properties": {
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "acceptedSnapshot",
                            "records"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "proposals",
                        "decisions"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposals": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "superseded",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z",
                        "supersededByProposalId": "proposal_01J8Z3R900"
                      }
                    ],
                    "decisions": [
                      {
                        "decisionId": "decision_01J8Z3R4YZ",
                        "proposalId": "proposal_01J8Z3R2WX",
                        "verb": "approve",
                        "decision": "accepted",
                        "reasons": [],
                        "connectionId": "conn_01J7X1A2BJ",
                        "credentialGrantId": "cred_01J7X1A2BK",
                        "principal": {
                          "kind": "user",
                          "id": "user_01J7X1A2BH"
                        },
                        "decidedAt": "2026-08-12T15:11:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/review/contradictions/resolve": {
      "post": {
        "operationId": "BrainReviewPlane_resolveContradiction",
        "tags": [
          "BrainReviewPlane"
        ],
        "summary": "Resolve two contending proposals by accepting one, rejecting the other.",
        "description": "For two staged proposals that cannot both land (they contend for the same field or claim) — `acceptProposalId` and `rejectProposalId` must name two DISTINCT proposals; the response's `decisions[]` links each outcome back to this one resolution. Requires the `review` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "review",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "expectedGeneration": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "acceptProposalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "rejectProposalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "reasons": {
                    "minItems": 1,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048
                    }
                  },
                  "itemDecisions": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "decision": {
                          "type": "string",
                          "enum": [
                            "accepted",
                            "rejected"
                          ]
                        },
                        "reason": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048
                        },
                        "mutationDecisions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mutationIndex": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "required": [
                              "mutationIndex",
                              "decision"
                            ]
                          }
                        }
                      },
                      "required": [
                        "itemId",
                        "decision"
                      ]
                    }
                  }
                },
                "required": [
                  "expectedGeneration",
                  "acceptProposalId",
                  "rejectProposalId",
                  "reasons"
                ]
              },
              "example": {
                "expectedGeneration": "gen_01J8Z3K7QW",
                "acceptProposalId": "proposal_01J8Z3R2WX",
                "rejectProposalId": "proposal_01J8Z3R2XY",
                "reasons": [
                  "The call transcript is the more recent source."
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "brainGeneration": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "partially_accepted",
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "decisionReason": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "batchId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "policyVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "connectionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "credentialGrantId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "producingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "itemId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "rejected",
                                        "failed",
                                        "reverted"
                                      ]
                                    },
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "slug": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "mutations": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "fields": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "entityKind",
                                              "fields"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "delete_entity"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "retype_entity"
                                              },
                                              "fromKind": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toKind": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "fromKind",
                                              "toKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "link"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "unlink"
                                              },
                                              "edge": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toTarget": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "edge",
                                              "toTarget"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "target": {
                                                "type": "object",
                                                "properties": {
                                                  "entityKind": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "slug": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "entityKind",
                                                  "slug"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseArtifactVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "proposedBody": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "target",
                                              "provenance",
                                              "kind",
                                              "proposedBody"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "evolve_schema"
                                              },
                                              "schemaSlug": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "delta": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "impact": {
                                                "type": "object",
                                                "properties": {
                                                  "entitiesAffected": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "fieldsLost": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string"
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "entitiesAffected",
                                                  "fieldsLost"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "provenance": {
                                                "type": "object",
                                                "properties": {
                                                  "actor": {
                                                    "oneOf": [
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "human"
                                                          },
                                                          "userId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "userId"
                                                        ],
                                                        "additionalProperties": false
                                                      },
                                                      {
                                                        "type": "object",
                                                        "properties": {
                                                          "kind": {
                                                            "type": "string",
                                                            "const": "agent"
                                                          },
                                                          "agentId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "runId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "kind",
                                                          "agentId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    ]
                                                  },
                                                  "origin": {
                                                    "type": "string",
                                                    "enum": [
                                                      "emitted",
                                                      "derived"
                                                    ]
                                                  },
                                                  "source": {
                                                    "type": "object",
                                                    "properties": {
                                                      "documentId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "passage": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "quote": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "actor",
                                                  "origin"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "baseSchemaVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "schemaSlug",
                                              "delta",
                                              "impact",
                                              "provenance"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "mutationDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "evidence": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "evidenceRefs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "evidenceId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "versionId": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          },
                                          "anchor": {
                                            "type": "object",
                                            "properties": {
                                              "locator": {
                                                "type": "object",
                                                "propertyNames": {
                                                  "type": "string"
                                                },
                                                "additionalProperties": {}
                                              },
                                              "fragmentHash": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 512
                                              },
                                              "quote": {
                                                "type": "string",
                                                "maxLength": 65536
                                              }
                                            },
                                            "required": [
                                              "locator",
                                              "fragmentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "evidenceId",
                                          "versionId",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "correctsEventId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "contendingProposalIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    }
                                  },
                                  "required": [
                                    "itemId",
                                    "state",
                                    "mutations",
                                    "mutationDecisions",
                                    "evidence",
                                    "evidenceRefs",
                                    "contendingProposalIds"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "proposalId",
                              "brainId",
                              "brainGeneration",
                              "state",
                              "reasons",
                              "provenance",
                              "items",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "decisions": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "decisionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "proposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "itemId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "verb": {
                                "type": "string",
                                "enum": [
                                  "approve",
                                  "edit_and_approve",
                                  "reject",
                                  "supersede",
                                  "resolve_contradiction"
                                ]
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "rejected",
                                  "superseded"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "connectionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "credentialGrantId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "user",
                                      "service",
                                      "agent",
                                      "oauth_client"
                                    ]
                                  },
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "supersededByProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "contendingProposalId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "resolutionId": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 512
                              },
                              "decidedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "decisionId",
                              "proposalId",
                              "verb",
                              "decision",
                              "reasons",
                              "connectionId",
                              "credentialGrantId",
                              "principal",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "applied": {
                          "type": "object",
                          "properties": {
                            "acceptedSnapshot": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "records": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "artifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  }
                                },
                                "required": [
                                  "slug",
                                  "artifactVersionId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "acceptedSnapshot",
                            "records"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "proposals",
                        "decisions"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "proposals": [
                      {
                        "proposalId": "proposal_01J8Z3R2WX",
                        "brainId": "brain_01J7X1A2BF",
                        "brainGeneration": "gen_01J8Z3K7QW",
                        "state": "accepted",
                        "reasons": [
                          "low_confidence_inference"
                        ],
                        "provenance": {
                          "connectionId": "conn_01J7X1A2BI"
                        },
                        "items": [
                          {
                            "itemId": "item_01J8Z3R2WY",
                            "state": "pending",
                            "entityKind": "lead",
                            "slug": "bob-smith-project-y-lead",
                            "mutations": [
                              {
                                "kind": "set_field",
                                "target": {
                                  "entityKind": "lead",
                                  "slug": "bob-smith-project-y-lead"
                                },
                                "field": "stage",
                                "value": "qualified",
                                "provenance": {
                                  "actor": {
                                    "kind": "agent",
                                    "agentId": "company-os-outreach-agent"
                                  },
                                  "origin": "derived"
                                }
                              }
                            ],
                            "mutationDecisions": [
                              "pending"
                            ],
                            "evidence": []
                          }
                        ],
                        "createdAt": "2026-08-12T15:10:00Z"
                      }
                    ],
                    "decisions": [
                      {
                        "decisionId": "decision_01J8Z3R4YZ",
                        "proposalId": "proposal_01J8Z3R2WX",
                        "verb": "approve",
                        "decision": "accepted",
                        "reasons": [],
                        "connectionId": "conn_01J7X1A2BJ",
                        "credentialGrantId": "cred_01J7X1A2BK",
                        "principal": {
                          "kind": "user",
                          "id": "user_01J7X1A2BH"
                        },
                        "decidedAt": "2026-08-12T15:11:00Z"
                      }
                    ],
                    "applied": {
                      "acceptedSnapshot": "snap_01J8Z3R500",
                      "records": [
                        {
                          "slug": "bob-smith-project-y-lead",
                          "entityKind": "lead",
                          "artifactVersionId": "artv_01J8Z3R501"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/profiles/{entityKind}/{slug}/working": {
      "get": {
        "operationId": "BrainProfilePlane_getWorkingProfile",
        "tags": [
          "BrainProfilePlane"
        ],
        "summary": "Read one entity's accepted state plus everything staged on top.",
        "description": "`accepted` is the canonical projection, unmodified; `staged` and `stagedProposals` show what's pending in Review that would change it. `semanticId`/`versionId` are absent when nothing is accepted yet — the entity exists only as staged proposals. Requires the `query` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "query",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "entityKind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "semanticId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "accepted": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "staged": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  },
                                  "staged": {
                                    "type": "boolean",
                                    "const": true
                                  },
                                  "proposalId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "reasons": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "baseArtifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "staleBase": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "field",
                                  "staged",
                                  "proposalId",
                                  "reasons",
                                  "staleBase"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "stagedProposals": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "proposalId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "reasons": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "mutationKinds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "baseArtifactVersionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "staleBase": {
                                    "type": "boolean"
                                  },
                                  "stagedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "proposalId",
                                  "reasons",
                                  "mutationKinds",
                                  "staleBase",
                                  "stagedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "evidenceRefs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "anchor": {
                                    "type": "object",
                                    "properties": {
                                      "locator": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "fragmentHash": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "quote": {
                                        "type": "string",
                                        "maxLength": 65536
                                      }
                                    },
                                    "required": [
                                      "locator",
                                      "fragmentHash"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "versionId",
                                  "contentHash"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "entityKind",
                            "slug",
                            "accepted",
                            "staged",
                            "stagedProposals",
                            "evidenceRefs"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead",
                      "semanticId": "bob-smith-project-y-lead",
                      "versionId": "artv_01J8Z3N4RY",
                      "accepted": {
                        "stage": "qualifying"
                      },
                      "staged": [],
                      "stagedProposals": [],
                      "evidenceRefs": []
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3T2CD",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [],
                      "committedAt": "2026-08-12T15:05:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/profiles/{entityKind}/{slug}/missing": {
      "get": {
        "operationId": "BrainProfilePlane_getMissingInformation",
        "tags": [
          "BrainProfilePlane"
        ],
        "summary": "Which declared fields this entity has no value for yet.",
        "description": "`contractDeclaresFields: false` means the Brain's declared schema names no fields for this kind — gaps are then unknowable, not empty, and the response says so rather than reporting a false zero. Requires the `query` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "query",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "entityKind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "semanticId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "contractDeclaresFields": {
                              "type": "boolean"
                            },
                            "gaps": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "declaredType": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "enumValues": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "stagedProposalIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  }
                                },
                                "required": [
                                  "field",
                                  "declaredType",
                                  "stagedProposalIds"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "conflicts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "acceptedValue": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  },
                                  "proposals": {
                                    "minItems": 2,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "proposalId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            }
                                          ]
                                        },
                                        "reasons": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 512
                                          }
                                        }
                                      },
                                      "required": [
                                        "proposalId",
                                        "reasons"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "field",
                                  "proposals"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "entityKind",
                            "slug",
                            "contractDeclaresFields",
                            "gaps",
                            "conflicts"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead",
                      "semanticId": "bob-smith-project-y-lead",
                      "versionId": "artv_01J8Z3N4RY",
                      "contractDeclaresFields": true,
                      "gaps": [],
                      "conflicts": []
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3T2CD",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [],
                      "committedAt": "2026-08-12T15:05:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/profiles/{entityKind}/{slug}/current": {
      "get": {
        "operationId": "BrainProfilePlane_getCurrent",
        "tags": [
          "BrainProfilePlane"
        ],
        "summary": "The entity's current best-known fields, standing answers included.",
        "description": "`source` names whether a field came from a maintained standing answer or the plain accepted state — the same distinction the correction/standing-answers substrate maintains. Requires the `query` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "query",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "entityKind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "semanticId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "versionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "standing_answers",
                                "accepted_state"
                              ]
                            },
                            "fields": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "answers": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "slug": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "question": {
                                    "type": "string"
                                  },
                                  "facet": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "body": {
                                    "type": "string"
                                  },
                                  "viaStatementSlugs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "staleness": {
                                    "type": "object",
                                    "properties": {
                                      "movedInputs": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "newEvidence": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "undatable": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "movedInputs",
                                      "newEvidence",
                                      "undatable"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "slug",
                                  "viaStatementSlugs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "evidenceRefs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "anchor": {
                                    "type": "object",
                                    "properties": {
                                      "locator": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "fragmentHash": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "quote": {
                                        "type": "string",
                                        "maxLength": 65536
                                      }
                                    },
                                    "required": [
                                      "locator",
                                      "fragmentHash"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "versionId",
                                  "contentHash"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "entityKind",
                            "slug",
                            "semanticId",
                            "versionId",
                            "source",
                            "fields",
                            "answers",
                            "evidenceRefs"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead",
                      "semanticId": "bob-smith-project-y-lead",
                      "versionId": "artv_01J8Z3N4RY",
                      "source": "accepted_state",
                      "fields": {
                        "stage": "qualifying"
                      },
                      "answers": [],
                      "evidenceRefs": []
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3T2CD",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [],
                      "committedAt": "2026-08-12T15:05:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{brainId}/connections/{connectionId}/profiles/{entityKind}/{slug}/diff": {
      "get": {
        "operationId": "BrainProfilePlane_getDiff",
        "tags": [
          "BrainProfilePlane"
        ],
        "summary": "This entity's change history over an optional date range.",
        "description": "Aggregated counts (`byChangeType`, `byActorKind`, `byDay`) plus the individual `changes[]`. `truncated: true` means the range holds more than this response returned — narrow `since`/`until` rather than treating the response as exhaustive. Unlike the other three profile reads, this one reads the change LOG, not the accepted-state projection, so it needs a broader read grant. Requires the `read` capability on the Brain Connection credential presented as `Authorization: Bearer <credential>` — the org API key is rejected here. The credential must also carry a REST-eligible protocol (`api`, `cli`, `typescript_sdk`, `python_sdk`); an `mcp` Connection cannot call this operation over HTTP.",
        "x-nicia-capability": "read",
        "security": [
          {
            "connectionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "brainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "consumerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "snapshot": {
                          "type": "object",
                          "properties": {
                            "brainId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "generation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "stateVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "schemaVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "policyVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "recordedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "validAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "brainId",
                            "generation",
                            "stateVersion",
                            "schemaVersion",
                            "policyVersion",
                            "recordedAt"
                          ],
                          "additionalProperties": false
                        },
                        "result": {
                          "type": "object",
                          "properties": {
                            "entityKind": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "since": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "until": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "total": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "truncated": {
                              "type": "boolean"
                            },
                            "byChangeType": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "byActorKind": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "byDay": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "day": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "day",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "distinctActors": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "changes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "eventId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "changeType": {
                                    "type": "string",
                                    "enum": [
                                      "created",
                                      "updated",
                                      "deleted"
                                    ]
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "agent",
                                      "user",
                                      "system"
                                    ]
                                  },
                                  "actorLabel": {
                                    "type": "string"
                                  },
                                  "causingRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "changeSetId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "agentName": {
                                        "type": "string"
                                      },
                                      "agentVersion": {
                                        "type": "string"
                                      },
                                      "model": {
                                        "type": "string"
                                      },
                                      "sources": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "tier": {
                                        "type": "string",
                                        "enum": [
                                          "boundary",
                                          "self_reported",
                                          "instrumented"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "tier"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "correctsEventId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "correctsAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  },
                                  "correctedByEventId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "correctedByAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "eventId",
                                  "at",
                                  "changeType",
                                  "actorKind"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "entityKind",
                            "slug",
                            "total",
                            "truncated",
                            "byChangeType",
                            "byActorKind",
                            "byDay",
                            "distinctActors",
                            "changes"
                          ],
                          "additionalProperties": false
                        },
                        "receipt": {
                          "type": "object",
                          "properties": {
                            "receiptId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "structured_read",
                                "context",
                                "search"
                              ]
                            },
                            "consumerId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "connectionId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "credentialGrantId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "snapshot": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "stateVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "schemaVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "policyVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "recordedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                },
                                "validAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                }
                              },
                              "required": [
                                "brainId",
                                "generation",
                                "stateVersion",
                                "schemaVersion",
                                "policyVersion",
                                "recordedAt"
                              ],
                              "additionalProperties": false
                            },
                            "requestHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "renderHash": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "items": {
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "semanticId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "versionId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "evidenceRefs": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "evidenceId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "versionId": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "contentHash": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 512
                                        },
                                        "anchor": {
                                          "type": "object",
                                          "properties": {
                                            "locator": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "fragmentHash": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 512
                                            },
                                            "quote": {
                                              "type": "string",
                                              "maxLength": 65536
                                            }
                                          },
                                          "required": [
                                            "locator",
                                            "fragmentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "evidenceId",
                                        "versionId",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "semanticId",
                                  "versionId",
                                  "evidenceRefs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "committedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "receiptId",
                            "kind",
                            "consumerId",
                            "connectionId",
                            "credentialGrantId",
                            "snapshot",
                            "requestHash",
                            "items",
                            "committedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot",
                        "result",
                        "receipt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "snapshot": {
                      "brainId": "brain_01J7X1A2BF",
                      "generation": "gen_01J8Z3K7QW",
                      "stateVersion": "sv_01J8Z3N4RU",
                      "schemaVersion": "schv_01J7X1A2BG",
                      "policyVersion": "policyv_01J7X1A2BC",
                      "recordedAt": "2026-08-12T15:05:00Z"
                    },
                    "result": {
                      "entityKind": "lead",
                      "slug": "bob-smith-project-y-lead",
                      "total": 1,
                      "truncated": false,
                      "byChangeType": {
                        "created": 1
                      },
                      "byActorKind": {
                        "agent": 1
                      },
                      "byDay": [
                        {
                          "day": "2026-08-12",
                          "count": 1
                        }
                      ],
                      "distinctActors": 1,
                      "changes": []
                    },
                    "receipt": {
                      "receiptId": "receipt_01J8Z3T2CD",
                      "kind": "structured_read",
                      "consumerId": "outreach-drafter",
                      "connectionId": "conn_01J7X1A2BD",
                      "credentialGrantId": "cred_01J7X1A2BE",
                      "snapshot": {
                        "brainId": "brain_01J7X1A2BF",
                        "generation": "gen_01J8Z3K7QW",
                        "stateVersion": "sv_01J8Z3N4RU",
                        "schemaVersion": "schv_01J7X1A2BG",
                        "policyVersion": "policyv_01J7X1A2BC",
                        "recordedAt": "2026-08-12T15:05:00Z"
                      },
                      "requestHash": "sha256:6b1e2f4a8c0d2e4f6a8c0d2e4f6a8c0d",
                      "items": [],
                      "committedAt": "2026-08-12T15:05:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets": {
      "get": {
        "operationId": "ChangeSet_listByAgent",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changesets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "adopting",
                                  "adopted",
                                  "reverting",
                                  "reverted",
                                  "rejected",
                                  "dismissed"
                                ]
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "feedback": {
                                "type": "string"
                              },
                              "predictedScore": {
                                "type": "number"
                              },
                              "actualScore": {
                                "type": "number"
                              },
                              "proposalSource": {
                                "type": "string",
                                "enum": [
                                  "reflection",
                                  "nightly_improvement",
                                  "knowledge_capture",
                                  "gardening",
                                  "automation",
                                  "semantic_kernel",
                                  "external_agent"
                                ]
                              },
                              "producingRunId": {
                                "type": "string"
                              },
                              "evidenceRunIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "agentName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "agentVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "externalRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "sources": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "brainMutationBatchId": {
                                "type": "string"
                              },
                              "brainMutationPolicyVersionId": {
                                "type": "string"
                              },
                              "brainMutationReasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenanceTier": {
                                "type": "string",
                                "enum": [
                                  "boundary",
                                  "self_reported",
                                  "instrumented"
                                ]
                              },
                              "evaluationState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "passed",
                                  "warned",
                                  "failed",
                                  "unavailable",
                                  "stale"
                                ]
                              },
                              "evaluationScore": {
                                "type": "number"
                              },
                              "evaluationRunId": {
                                "type": "string"
                              },
                              "evaluationFingerprint": {
                                "type": "string"
                              },
                              "evaluatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "evaluationOverride": {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string"
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "overriddenAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "reason",
                                  "actorKind",
                                  "evaluationState",
                                  "overriddenAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "status",
                              "provenanceTier",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "changesets"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "ChangeSet_create",
        "tags": [
          "ChangeSet"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "producingRunId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "goalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "evalRunId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reasoning": {
                    "type": "string"
                  },
                  "predictedScore": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "provenance": {
                    "type": "object",
                    "properties": {
                      "agentName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "agentVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "model": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "externalRunId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "sources": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        }
                      }
                    }
                  },
                  "items": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "itemType": {
                          "type": "string",
                          "enum": [
                            "system_prompt",
                            "artifact",
                            "skill_version",
                            "corpus_membership",
                            "knowledge_entity",
                            "knowledge_schema",
                            "brain_automation"
                          ]
                        },
                        "targetId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetCorpusId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "beforeHash": {
                          "type": "string"
                        },
                        "afterHash": {
                          "type": "string"
                        },
                        "beforeContent": {
                          "type": "string"
                        },
                        "afterContent": {
                          "type": "string"
                        },
                        "baseCorpusVersionId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sourceRunArtifactId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sourceArtifactId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "entityKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "entitySlug": {
                          "type": "string",
                          "minLength": 1
                        },
                        "baseArtifactVersionId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "justification": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "itemType"
                      ]
                    }
                  }
                },
                "required": [
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/pending": {
      "get": {
        "operationId": "ChangeSet_pendingByAgent",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changesets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "adopting",
                                  "adopted",
                                  "reverting",
                                  "reverted",
                                  "rejected",
                                  "dismissed"
                                ]
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "feedback": {
                                "type": "string"
                              },
                              "predictedScore": {
                                "type": "number"
                              },
                              "actualScore": {
                                "type": "number"
                              },
                              "proposalSource": {
                                "type": "string",
                                "enum": [
                                  "reflection",
                                  "nightly_improvement",
                                  "knowledge_capture",
                                  "gardening",
                                  "automation",
                                  "semantic_kernel",
                                  "external_agent"
                                ]
                              },
                              "producingRunId": {
                                "type": "string"
                              },
                              "evidenceRunIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "agentName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "agentVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "externalRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "sources": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "brainMutationBatchId": {
                                "type": "string"
                              },
                              "brainMutationPolicyVersionId": {
                                "type": "string"
                              },
                              "brainMutationReasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenanceTier": {
                                "type": "string",
                                "enum": [
                                  "boundary",
                                  "self_reported",
                                  "instrumented"
                                ]
                              },
                              "evaluationState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "passed",
                                  "warned",
                                  "failed",
                                  "unavailable",
                                  "stale"
                                ]
                              },
                              "evaluationScore": {
                                "type": "number"
                              },
                              "evaluationRunId": {
                                "type": "string"
                              },
                              "evaluationFingerprint": {
                                "type": "string"
                              },
                              "evaluatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "evaluationOverride": {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string"
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "overriddenAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "reason",
                                  "actorKind",
                                  "evaluationState",
                                  "overriddenAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "status",
                              "provenanceTier",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "changesets"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/inbox": {
      "get": {
        "operationId": "ChangeSet_inbox",
        "tags": [
          "ChangeSet"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pending": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "changeset": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "proposed",
                                      "adopting",
                                      "adopted",
                                      "reverting",
                                      "reverted",
                                      "rejected",
                                      "dismissed"
                                    ]
                                  },
                                  "reasoning": {
                                    "type": "string"
                                  },
                                  "feedback": {
                                    "type": "string"
                                  },
                                  "predictedScore": {
                                    "type": "number"
                                  },
                                  "actualScore": {
                                    "type": "number"
                                  },
                                  "proposalSource": {
                                    "type": "string",
                                    "enum": [
                                      "reflection",
                                      "nightly_improvement",
                                      "knowledge_capture",
                                      "gardening",
                                      "automation",
                                      "semantic_kernel",
                                      "external_agent"
                                    ]
                                  },
                                  "producingRunId": {
                                    "type": "string"
                                  },
                                  "evidenceRunIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "agentName": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "agentVersion": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "model": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "externalRunId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "sources": {
                                        "maxItems": 50,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 500
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "brainMutationBatchId": {
                                    "type": "string"
                                  },
                                  "brainMutationPolicyVersionId": {
                                    "type": "string"
                                  },
                                  "brainMutationReasons": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenanceTier": {
                                    "type": "string",
                                    "enum": [
                                      "boundary",
                                      "self_reported",
                                      "instrumented"
                                    ]
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "evaluationScore": {
                                    "type": "number"
                                  },
                                  "evaluationRunId": {
                                    "type": "string"
                                  },
                                  "evaluationFingerprint": {
                                    "type": "string"
                                  },
                                  "evaluatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "evaluationOverride": {
                                    "type": "object",
                                    "properties": {
                                      "reason": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string"
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "evaluationState": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "running",
                                          "passed",
                                          "warned",
                                          "failed",
                                          "unavailable",
                                          "stale"
                                        ]
                                      },
                                      "overriddenAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      }
                                    },
                                    "required": [
                                      "reason",
                                      "actorKind",
                                      "evaluationState",
                                      "overriddenAt"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "status",
                                  "provenanceTier",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "itemCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "route": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "goal"
                                      },
                                      "goalId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "goalId"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "brain"
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "knowledgeGraphId"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "changeset",
                              "itemCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "changeset": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "proposed",
                                      "adopting",
                                      "adopted",
                                      "reverting",
                                      "reverted",
                                      "rejected",
                                      "dismissed"
                                    ]
                                  },
                                  "reasoning": {
                                    "type": "string"
                                  },
                                  "feedback": {
                                    "type": "string"
                                  },
                                  "predictedScore": {
                                    "type": "number"
                                  },
                                  "actualScore": {
                                    "type": "number"
                                  },
                                  "proposalSource": {
                                    "type": "string",
                                    "enum": [
                                      "reflection",
                                      "nightly_improvement",
                                      "knowledge_capture",
                                      "gardening",
                                      "automation",
                                      "semantic_kernel",
                                      "external_agent"
                                    ]
                                  },
                                  "producingRunId": {
                                    "type": "string"
                                  },
                                  "evidenceRunIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "agentName": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "agentVersion": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "model": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "externalRunId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "sources": {
                                        "maxItems": 50,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 500
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "brainMutationBatchId": {
                                    "type": "string"
                                  },
                                  "brainMutationPolicyVersionId": {
                                    "type": "string"
                                  },
                                  "brainMutationReasons": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenanceTier": {
                                    "type": "string",
                                    "enum": [
                                      "boundary",
                                      "self_reported",
                                      "instrumented"
                                    ]
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "evaluationScore": {
                                    "type": "number"
                                  },
                                  "evaluationRunId": {
                                    "type": "string"
                                  },
                                  "evaluationFingerprint": {
                                    "type": "string"
                                  },
                                  "evaluatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "evaluationOverride": {
                                    "type": "object",
                                    "properties": {
                                      "reason": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string"
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "evaluationState": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "running",
                                          "passed",
                                          "warned",
                                          "failed",
                                          "unavailable",
                                          "stale"
                                        ]
                                      },
                                      "overriddenAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      }
                                    },
                                    "required": [
                                      "reason",
                                      "actorKind",
                                      "evaluationState",
                                      "overriddenAt"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "status",
                                  "provenanceTier",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "itemCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "route": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "goal"
                                      },
                                      "goalId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "goalId"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "brain"
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "knowledgeGraphId"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "changeset",
                              "itemCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "pending",
                        "history"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}": {
      "get": {
        "operationId": "ChangeSet_get",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "itemType": {
                                "type": "string",
                                "enum": [
                                  "system_prompt",
                                  "artifact",
                                  "skill_version",
                                  "corpus_membership",
                                  "knowledge_entity",
                                  "knowledge_schema",
                                  "brain_automation"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "applied",
                                  "reverted",
                                  "failed",
                                  "rejected"
                                ]
                              },
                              "targetId": {
                                "type": "string"
                              },
                              "beforeHash": {
                                "type": "string"
                              },
                              "afterHash": {
                                "type": "string"
                              },
                              "beforeContent": {
                                "type": "string"
                              },
                              "afterContent": {
                                "type": "string"
                              },
                              "resultingSkillVersionId": {
                                "type": "string"
                              },
                              "resultingArtifactVersionId": {
                                "type": "string"
                              },
                              "resultingAgentPromptVersionId": {
                                "type": "string"
                              },
                              "baseCorpusVersionId": {
                                "type": "string"
                              },
                              "sourceRunArtifactId": {
                                "type": "string"
                              },
                              "sourceArtifactId": {
                                "type": "string"
                              },
                              "resultingArtifactId": {
                                "type": "string"
                              },
                              "resultingCorpusVersionId": {
                                "type": "string"
                              },
                              "resultingAutomationId": {
                                "type": "string"
                              },
                              "entityKind": {
                                "type": "string"
                              },
                              "entitySlug": {
                                "type": "string"
                              },
                              "baseArtifactVersionId": {
                                "type": "string"
                              },
                              "correctsEventId": {
                                "type": "string"
                              },
                              "justification": {
                                "type": "string"
                              },
                              "assertions": {
                                "type": "array",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "create_entity"
                                        },
                                        "entityKind": {
                                          "type": "string"
                                        },
                                        "source": {
                                          "type": "object",
                                          "properties": {
                                            "documentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "passage": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "quote": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "entityKind"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "retype"
                                        },
                                        "before": {
                                          "type": "string"
                                        },
                                        "after": {
                                          "type": "string"
                                        },
                                        "source": {
                                          "type": "object",
                                          "properties": {
                                            "documentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "passage": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "quote": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "before",
                                        "after"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "set_field"
                                        },
                                        "field": {
                                          "type": "string"
                                        },
                                        "before": {
                                          "type": "string"
                                        },
                                        "after": {
                                          "type": "string"
                                        },
                                        "source": {
                                          "type": "object",
                                          "properties": {
                                            "documentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "passage": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "quote": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "field"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "edit_body"
                                        },
                                        "source": {
                                          "type": "object",
                                          "properties": {
                                            "documentId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "passage": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "quote": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "assertionsOrigin": {
                                "type": "string",
                                "enum": [
                                  "emitted",
                                  "derived"
                                ]
                              },
                              "mutationReview": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "kind": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "reversibility": {
                                      "type": "string",
                                      "enum": [
                                        "reversible",
                                        "lossy",
                                        "destructive"
                                      ]
                                    },
                                    "decision": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "accepted",
                                        "rejected"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "index",
                                    "kind",
                                    "label",
                                    "reversibility",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "bodyHunkDecisions": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "accepted",
                                    "rejected"
                                  ]
                                }
                              },
                              "failureReason": {
                                "type": "string"
                              },
                              "failureDetail": {},
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "itemType",
                              "status",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "changeset",
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/adopt": {
      "post": {
        "operationId": "ChangeSet_adopt",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "evaluationOverrideReason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/evaluations": {
      "post": {
        "operationId": "ChangeSet_evaluate",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/revert": {
      "post": {
        "operationId": "ChangeSet_revert",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/reject": {
      "post": {
        "operationId": "ChangeSet_reject",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "feedback": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "feedback"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/dismiss": {
      "post": {
        "operationId": "ChangeSet_dismiss",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changeset": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "adopting",
                                "adopted",
                                "reverting",
                                "reverted",
                                "rejected",
                                "dismissed"
                              ]
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "feedback": {
                              "type": "string"
                            },
                            "predictedScore": {
                              "type": "number"
                            },
                            "actualScore": {
                              "type": "number"
                            },
                            "proposalSource": {
                              "type": "string",
                              "enum": [
                                "reflection",
                                "nightly_improvement",
                                "knowledge_capture",
                                "gardening",
                                "automation",
                                "semantic_kernel",
                                "external_agent"
                              ]
                            },
                            "producingRunId": {
                              "type": "string"
                            },
                            "evidenceRunIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "agentVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "externalRunId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "sources": {
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 500
                                  }
                                }
                              },
                              "additionalProperties": false
                            },
                            "brainMutationBatchId": {
                              "type": "string"
                            },
                            "brainMutationPolicyVersionId": {
                              "type": "string"
                            },
                            "brainMutationReasons": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "provenanceTier": {
                              "type": "string",
                              "enum": [
                                "boundary",
                                "self_reported",
                                "instrumented"
                              ]
                            },
                            "evaluationState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "passed",
                                "warned",
                                "failed",
                                "unavailable",
                                "stale"
                              ]
                            },
                            "evaluationScore": {
                              "type": "number"
                            },
                            "evaluationRunId": {
                              "type": "string"
                            },
                            "evaluationFingerprint": {
                              "type": "string"
                            },
                            "evaluatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "evaluationOverride": {
                              "type": "object",
                              "properties": {
                                "reason": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string"
                                },
                                "actorId": {
                                  "type": "string"
                                },
                                "evaluationState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "passed",
                                    "warned",
                                    "failed",
                                    "unavailable",
                                    "stale"
                                  ]
                                },
                                "overriddenAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "reason",
                                "actorKind",
                                "evaluationState",
                                "overriddenAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "provenanceTier",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "appliedItemCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "changeset"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/items/{itemId}/reject": {
      "post": {
        "operationId": "ChangeSet_rejectItem",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "wrong_value",
                      "wrong_entity",
                      "source_unsupported",
                      "too_speculative",
                      "other"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "item": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "itemType": {
                              "type": "string",
                              "enum": [
                                "system_prompt",
                                "artifact",
                                "skill_version",
                                "corpus_membership",
                                "knowledge_entity",
                                "knowledge_schema",
                                "brain_automation"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "applied",
                                "reverted",
                                "failed",
                                "rejected"
                              ]
                            },
                            "targetId": {
                              "type": "string"
                            },
                            "beforeHash": {
                              "type": "string"
                            },
                            "afterHash": {
                              "type": "string"
                            },
                            "beforeContent": {
                              "type": "string"
                            },
                            "afterContent": {
                              "type": "string"
                            },
                            "resultingSkillVersionId": {
                              "type": "string"
                            },
                            "resultingArtifactVersionId": {
                              "type": "string"
                            },
                            "resultingAgentPromptVersionId": {
                              "type": "string"
                            },
                            "baseCorpusVersionId": {
                              "type": "string"
                            },
                            "sourceRunArtifactId": {
                              "type": "string"
                            },
                            "sourceArtifactId": {
                              "type": "string"
                            },
                            "resultingArtifactId": {
                              "type": "string"
                            },
                            "resultingCorpusVersionId": {
                              "type": "string"
                            },
                            "resultingAutomationId": {
                              "type": "string"
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "entitySlug": {
                              "type": "string"
                            },
                            "baseArtifactVersionId": {
                              "type": "string"
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "justification": {
                              "type": "string"
                            },
                            "assertions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "create_entity"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entityKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "retype"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "before",
                                      "after"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "set_field"
                                      },
                                      "field": {
                                        "type": "string"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "edit_body"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "assertionsOrigin": {
                              "type": "string",
                              "enum": [
                                "emitted",
                                "derived"
                              ]
                            },
                            "mutationReview": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "index": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "reversibility": {
                                    "type": "string",
                                    "enum": [
                                      "reversible",
                                      "lossy",
                                      "destructive"
                                    ]
                                  },
                                  "decision": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "accepted",
                                      "rejected"
                                    ]
                                  }
                                },
                                "required": [
                                  "index",
                                  "kind",
                                  "label",
                                  "reversibility",
                                  "decision"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "bodyHunkDecisions": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "failureDetail": {},
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "itemType",
                            "status",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "item"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/items/{itemId}/unreject": {
      "post": {
        "operationId": "ChangeSet_unrejectItem",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "item": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "itemType": {
                              "type": "string",
                              "enum": [
                                "system_prompt",
                                "artifact",
                                "skill_version",
                                "corpus_membership",
                                "knowledge_entity",
                                "knowledge_schema",
                                "brain_automation"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "applied",
                                "reverted",
                                "failed",
                                "rejected"
                              ]
                            },
                            "targetId": {
                              "type": "string"
                            },
                            "beforeHash": {
                              "type": "string"
                            },
                            "afterHash": {
                              "type": "string"
                            },
                            "beforeContent": {
                              "type": "string"
                            },
                            "afterContent": {
                              "type": "string"
                            },
                            "resultingSkillVersionId": {
                              "type": "string"
                            },
                            "resultingArtifactVersionId": {
                              "type": "string"
                            },
                            "resultingAgentPromptVersionId": {
                              "type": "string"
                            },
                            "baseCorpusVersionId": {
                              "type": "string"
                            },
                            "sourceRunArtifactId": {
                              "type": "string"
                            },
                            "sourceArtifactId": {
                              "type": "string"
                            },
                            "resultingArtifactId": {
                              "type": "string"
                            },
                            "resultingCorpusVersionId": {
                              "type": "string"
                            },
                            "resultingAutomationId": {
                              "type": "string"
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "entitySlug": {
                              "type": "string"
                            },
                            "baseArtifactVersionId": {
                              "type": "string"
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "justification": {
                              "type": "string"
                            },
                            "assertions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "create_entity"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entityKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "retype"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "before",
                                      "after"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "set_field"
                                      },
                                      "field": {
                                        "type": "string"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "edit_body"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "assertionsOrigin": {
                              "type": "string",
                              "enum": [
                                "emitted",
                                "derived"
                              ]
                            },
                            "mutationReview": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "index": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "reversibility": {
                                    "type": "string",
                                    "enum": [
                                      "reversible",
                                      "lossy",
                                      "destructive"
                                    ]
                                  },
                                  "decision": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "accepted",
                                      "rejected"
                                    ]
                                  }
                                },
                                "required": [
                                  "index",
                                  "kind",
                                  "label",
                                  "reversibility",
                                  "decision"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "bodyHunkDecisions": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "failureDetail": {},
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "itemType",
                            "status",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "item"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/items/{itemId}/mutation-decision": {
      "post": {
        "operationId": "ChangeSet_setMutationDecision",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "mutationIndex": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "accepted",
                      "rejected"
                    ]
                  }
                },
                "required": [
                  "mutationIndex",
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "item": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "itemType": {
                              "type": "string",
                              "enum": [
                                "system_prompt",
                                "artifact",
                                "skill_version",
                                "corpus_membership",
                                "knowledge_entity",
                                "knowledge_schema",
                                "brain_automation"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "applied",
                                "reverted",
                                "failed",
                                "rejected"
                              ]
                            },
                            "targetId": {
                              "type": "string"
                            },
                            "beforeHash": {
                              "type": "string"
                            },
                            "afterHash": {
                              "type": "string"
                            },
                            "beforeContent": {
                              "type": "string"
                            },
                            "afterContent": {
                              "type": "string"
                            },
                            "resultingSkillVersionId": {
                              "type": "string"
                            },
                            "resultingArtifactVersionId": {
                              "type": "string"
                            },
                            "resultingAgentPromptVersionId": {
                              "type": "string"
                            },
                            "baseCorpusVersionId": {
                              "type": "string"
                            },
                            "sourceRunArtifactId": {
                              "type": "string"
                            },
                            "sourceArtifactId": {
                              "type": "string"
                            },
                            "resultingArtifactId": {
                              "type": "string"
                            },
                            "resultingCorpusVersionId": {
                              "type": "string"
                            },
                            "resultingAutomationId": {
                              "type": "string"
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "entitySlug": {
                              "type": "string"
                            },
                            "baseArtifactVersionId": {
                              "type": "string"
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "justification": {
                              "type": "string"
                            },
                            "assertions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "create_entity"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entityKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "retype"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "before",
                                      "after"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "set_field"
                                      },
                                      "field": {
                                        "type": "string"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "edit_body"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "assertionsOrigin": {
                              "type": "string",
                              "enum": [
                                "emitted",
                                "derived"
                              ]
                            },
                            "mutationReview": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "index": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "reversibility": {
                                    "type": "string",
                                    "enum": [
                                      "reversible",
                                      "lossy",
                                      "destructive"
                                    ]
                                  },
                                  "decision": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "accepted",
                                      "rejected"
                                    ]
                                  }
                                },
                                "required": [
                                  "index",
                                  "kind",
                                  "label",
                                  "reversibility",
                                  "decision"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "bodyHunkDecisions": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "failureDetail": {},
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "itemType",
                            "status",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "item"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/changesets/{changeSetId}/items/{itemId}/hunk-decision": {
      "post": {
        "operationId": "ChangeSet_setBodyHunkDecision",
        "tags": [
          "ChangeSet"
        ],
        "parameters": [
          {
            "name": "changeSetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "hunkIndex": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "accepted",
                      "rejected"
                    ]
                  }
                },
                "required": [
                  "hunkIndex",
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "item": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "itemType": {
                              "type": "string",
                              "enum": [
                                "system_prompt",
                                "artifact",
                                "skill_version",
                                "corpus_membership",
                                "knowledge_entity",
                                "knowledge_schema",
                                "brain_automation"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "applied",
                                "reverted",
                                "failed",
                                "rejected"
                              ]
                            },
                            "targetId": {
                              "type": "string"
                            },
                            "beforeHash": {
                              "type": "string"
                            },
                            "afterHash": {
                              "type": "string"
                            },
                            "beforeContent": {
                              "type": "string"
                            },
                            "afterContent": {
                              "type": "string"
                            },
                            "resultingSkillVersionId": {
                              "type": "string"
                            },
                            "resultingArtifactVersionId": {
                              "type": "string"
                            },
                            "resultingAgentPromptVersionId": {
                              "type": "string"
                            },
                            "baseCorpusVersionId": {
                              "type": "string"
                            },
                            "sourceRunArtifactId": {
                              "type": "string"
                            },
                            "sourceArtifactId": {
                              "type": "string"
                            },
                            "resultingArtifactId": {
                              "type": "string"
                            },
                            "resultingCorpusVersionId": {
                              "type": "string"
                            },
                            "resultingAutomationId": {
                              "type": "string"
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "entitySlug": {
                              "type": "string"
                            },
                            "baseArtifactVersionId": {
                              "type": "string"
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "justification": {
                              "type": "string"
                            },
                            "assertions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "create_entity"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "entityKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "retype"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "before",
                                      "after"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "set_field"
                                      },
                                      "field": {
                                        "type": "string"
                                      },
                                      "before": {
                                        "type": "string"
                                      },
                                      "after": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "edit_body"
                                      },
                                      "source": {
                                        "type": "object",
                                        "properties": {
                                          "documentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "passage": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "quote": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "assertionsOrigin": {
                              "type": "string",
                              "enum": [
                                "emitted",
                                "derived"
                              ]
                            },
                            "mutationReview": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "index": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "reversibility": {
                                    "type": "string",
                                    "enum": [
                                      "reversible",
                                      "lossy",
                                      "destructive"
                                    ]
                                  },
                                  "decision": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "accepted",
                                      "rejected"
                                    ]
                                  }
                                },
                                "required": [
                                  "index",
                                  "kind",
                                  "label",
                                  "reversibility",
                                  "decision"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "bodyHunkDecisions": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "accepted",
                                  "rejected"
                                ]
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "failureDetail": {},
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "itemType",
                            "status",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "item"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors": {
      "get": {
        "operationId": "Connector_list",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "mcp_server",
                "http_endpoint",
                "webhook_outbound"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "paused",
                "errored"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connectors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "mcp_server",
                                  "http_endpoint",
                                  "webhook_outbound"
                                ]
                              },
                              "displayName": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "errored"
                                ]
                              },
                              "endpointConfig": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "mcp_server"
                                      },
                                      "transport": {
                                        "type": "string",
                                        "enum": [
                                          "streamable_http"
                                        ]
                                      },
                                      "url": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "serverSlug": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "defaultHeaders": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "apiKeyHeaderName": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "url",
                                      "serverSlug"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "http_endpoint"
                                      },
                                      "baseUrl": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "defaultHeaders": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "tools": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "method": {
                                              "default": "POST",
                                              "type": "string",
                                              "enum": [
                                                "GET",
                                                "POST",
                                                "PUT",
                                                "PATCH",
                                                "DELETE"
                                              ]
                                            },
                                            "path": {
                                              "type": "string"
                                            },
                                            "inputSchema": {},
                                            "outputSchema": {}
                                          },
                                          "required": [
                                            "name",
                                            "method",
                                            "path",
                                            "inputSchema"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "auth": {
                                        "type": "object",
                                        "properties": {
                                          "in": {
                                            "type": "string",
                                            "enum": [
                                              "header",
                                              "query"
                                            ]
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scheme": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "in",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "oauth2": {
                                        "type": "object",
                                        "properties": {
                                          "tokenUrl": {
                                            "type": "string",
                                            "format": "uri"
                                          },
                                          "scopes": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        },
                                        "required": [
                                          "tokenUrl"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "hmac": {
                                        "type": "object",
                                        "properties": {
                                          "algorithm": {
                                            "default": "sha256",
                                            "type": "string",
                                            "enum": [
                                              "sha256",
                                              "sha512"
                                            ]
                                          },
                                          "encoding": {
                                            "default": "hex",
                                            "type": "string",
                                            "enum": [
                                              "hex",
                                              "base64"
                                            ]
                                          },
                                          "signatureHeader": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "signedComponents": {
                                            "minItems": 1,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "enum": [
                                                "timestamp",
                                                "method",
                                                "path",
                                                "query",
                                                "body"
                                              ]
                                            }
                                          },
                                          "separator": {
                                            "type": "string"
                                          },
                                          "timestampHeader": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "signaturePrefix": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "algorithm",
                                          "encoding",
                                          "signatureHeader",
                                          "signedComponents"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "baseUrl",
                                      "tools"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "webhook_outbound"
                                      },
                                      "url": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "signingSecretRef": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "basePolicy": {
                                "type": "object",
                                "properties": {
                                  "trustBoundary": {
                                    "type": "string",
                                    "enum": [
                                      "local",
                                      "tenant_private",
                                      "external_remote"
                                    ]
                                  },
                                  "allowedAgentIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "allowedToolNames": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "rateLimitPerMinute": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "budgetCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "additionalProperties": false
                              },
                              "metadata": {},
                              "lastErrorAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "lastError": {
                                "type": "string"
                              },
                              "deletedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "kind",
                              "displayName",
                              "state",
                              "endpointConfig",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "connectors"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Connector_create",
        "tags": [
          "Connector"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "mcp_server",
                      "http_endpoint",
                      "webhook_outbound"
                    ]
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "endpointConfig": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "mcp_server"
                          },
                          "transport": {
                            "type": "string",
                            "enum": [
                              "streamable_http"
                            ]
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "serverSlug": {
                            "type": "string",
                            "minLength": 1
                          },
                          "defaultHeaders": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "apiKeyHeaderName": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "kind",
                          "url",
                          "serverSlug"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "http_endpoint"
                          },
                          "baseUrl": {
                            "type": "string",
                            "format": "uri"
                          },
                          "defaultHeaders": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "tools": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "method": {
                                  "default": "POST",
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "POST",
                                    "PUT",
                                    "PATCH",
                                    "DELETE"
                                  ]
                                },
                                "path": {
                                  "type": "string"
                                },
                                "inputSchema": {},
                                "outputSchema": {}
                              },
                              "required": [
                                "name",
                                "path",
                                "inputSchema"
                              ]
                            }
                          },
                          "auth": {
                            "type": "object",
                            "properties": {
                              "in": {
                                "type": "string",
                                "enum": [
                                  "header",
                                  "query"
                                ]
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "scheme": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "in",
                              "name"
                            ]
                          },
                          "oauth2": {
                            "type": "object",
                            "properties": {
                              "tokenUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "tokenUrl"
                            ]
                          },
                          "hmac": {
                            "type": "object",
                            "properties": {
                              "algorithm": {
                                "default": "sha256",
                                "type": "string",
                                "enum": [
                                  "sha256",
                                  "sha512"
                                ]
                              },
                              "encoding": {
                                "default": "hex",
                                "type": "string",
                                "enum": [
                                  "hex",
                                  "base64"
                                ]
                              },
                              "signatureHeader": {
                                "type": "string",
                                "minLength": 1
                              },
                              "signedComponents": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "timestamp",
                                    "method",
                                    "path",
                                    "query",
                                    "body"
                                  ]
                                }
                              },
                              "separator": {
                                "type": "string"
                              },
                              "timestampHeader": {
                                "type": "string",
                                "minLength": 1
                              },
                              "signaturePrefix": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "signatureHeader",
                              "signedComponents"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "baseUrl"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "webhook_outbound"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "signingSecretRef": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "url"
                        ]
                      }
                    ]
                  },
                  "basePolicy": {
                    "type": "object",
                    "properties": {
                      "trustBoundary": {
                        "type": "string",
                        "enum": [
                          "local",
                          "tenant_private",
                          "external_remote"
                        ]
                      },
                      "allowedAgentIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allowedToolNames": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "rateLimitPerMinute": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "budgetCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  }
                },
                "required": [
                  "kind",
                  "displayName",
                  "endpointConfig"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connector": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "mcp_server",
                                "http_endpoint",
                                "webhook_outbound"
                              ]
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "errored"
                              ]
                            },
                            "endpointConfig": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "mcp_server"
                                    },
                                    "transport": {
                                      "type": "string",
                                      "enum": [
                                        "streamable_http"
                                      ]
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "serverSlug": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "apiKeyHeaderName": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url",
                                    "serverSlug"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "http_endpoint"
                                    },
                                    "baseUrl": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "tools": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "default": "POST",
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "PUT",
                                              "PATCH",
                                              "DELETE"
                                            ]
                                          },
                                          "path": {
                                            "type": "string"
                                          },
                                          "inputSchema": {},
                                          "outputSchema": {}
                                        },
                                        "required": [
                                          "name",
                                          "method",
                                          "path",
                                          "inputSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "auth": {
                                      "type": "object",
                                      "properties": {
                                        "in": {
                                          "type": "string",
                                          "enum": [
                                            "header",
                                            "query"
                                          ]
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scheme": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "in",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "oauth2": {
                                      "type": "object",
                                      "properties": {
                                        "tokenUrl": {
                                          "type": "string",
                                          "format": "uri"
                                        },
                                        "scopes": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "tokenUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "hmac": {
                                      "type": "object",
                                      "properties": {
                                        "algorithm": {
                                          "default": "sha256",
                                          "type": "string",
                                          "enum": [
                                            "sha256",
                                            "sha512"
                                          ]
                                        },
                                        "encoding": {
                                          "default": "hex",
                                          "type": "string",
                                          "enum": [
                                            "hex",
                                            "base64"
                                          ]
                                        },
                                        "signatureHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signedComponents": {
                                          "minItems": 1,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "timestamp",
                                              "method",
                                              "path",
                                              "query",
                                              "body"
                                            ]
                                          }
                                        },
                                        "separator": {
                                          "type": "string"
                                        },
                                        "timestampHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signaturePrefix": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "algorithm",
                                        "encoding",
                                        "signatureHeader",
                                        "signedComponents"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "baseUrl",
                                    "tools"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "webhook_outbound"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "signingSecretRef": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "basePolicy": {
                              "type": "object",
                              "properties": {
                                "trustBoundary": {
                                  "type": "string",
                                  "enum": [
                                    "local",
                                    "tenant_private",
                                    "external_remote"
                                  ]
                                },
                                "allowedAgentIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "allowedToolNames": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rateLimitPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "budgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "additionalProperties": false
                            },
                            "metadata": {},
                            "lastErrorAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastError": {
                              "type": "string"
                            },
                            "deletedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "kind",
                            "displayName",
                            "state",
                            "endpointConfig",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "connector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors/{connectorId}": {
      "get": {
        "operationId": "Connector_get",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connector": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "mcp_server",
                                "http_endpoint",
                                "webhook_outbound"
                              ]
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "errored"
                              ]
                            },
                            "endpointConfig": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "mcp_server"
                                    },
                                    "transport": {
                                      "type": "string",
                                      "enum": [
                                        "streamable_http"
                                      ]
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "serverSlug": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "apiKeyHeaderName": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url",
                                    "serverSlug"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "http_endpoint"
                                    },
                                    "baseUrl": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "tools": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "default": "POST",
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "PUT",
                                              "PATCH",
                                              "DELETE"
                                            ]
                                          },
                                          "path": {
                                            "type": "string"
                                          },
                                          "inputSchema": {},
                                          "outputSchema": {}
                                        },
                                        "required": [
                                          "name",
                                          "method",
                                          "path",
                                          "inputSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "auth": {
                                      "type": "object",
                                      "properties": {
                                        "in": {
                                          "type": "string",
                                          "enum": [
                                            "header",
                                            "query"
                                          ]
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scheme": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "in",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "oauth2": {
                                      "type": "object",
                                      "properties": {
                                        "tokenUrl": {
                                          "type": "string",
                                          "format": "uri"
                                        },
                                        "scopes": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "tokenUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "hmac": {
                                      "type": "object",
                                      "properties": {
                                        "algorithm": {
                                          "default": "sha256",
                                          "type": "string",
                                          "enum": [
                                            "sha256",
                                            "sha512"
                                          ]
                                        },
                                        "encoding": {
                                          "default": "hex",
                                          "type": "string",
                                          "enum": [
                                            "hex",
                                            "base64"
                                          ]
                                        },
                                        "signatureHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signedComponents": {
                                          "minItems": 1,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "timestamp",
                                              "method",
                                              "path",
                                              "query",
                                              "body"
                                            ]
                                          }
                                        },
                                        "separator": {
                                          "type": "string"
                                        },
                                        "timestampHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signaturePrefix": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "algorithm",
                                        "encoding",
                                        "signatureHeader",
                                        "signedComponents"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "baseUrl",
                                    "tools"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "webhook_outbound"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "signingSecretRef": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "basePolicy": {
                              "type": "object",
                              "properties": {
                                "trustBoundary": {
                                  "type": "string",
                                  "enum": [
                                    "local",
                                    "tenant_private",
                                    "external_remote"
                                  ]
                                },
                                "allowedAgentIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "allowedToolNames": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rateLimitPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "budgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "additionalProperties": false
                            },
                            "metadata": {},
                            "lastErrorAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastError": {
                              "type": "string"
                            },
                            "deletedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "kind",
                            "displayName",
                            "state",
                            "endpointConfig",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "connector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Connector_update",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "errored"
                    ]
                  },
                  "endpointConfig": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "mcp_server"
                          },
                          "transport": {
                            "type": "string",
                            "enum": [
                              "streamable_http"
                            ]
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "serverSlug": {
                            "type": "string",
                            "minLength": 1
                          },
                          "defaultHeaders": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "apiKeyHeaderName": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "kind",
                          "url",
                          "serverSlug"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "http_endpoint"
                          },
                          "baseUrl": {
                            "type": "string",
                            "format": "uri"
                          },
                          "defaultHeaders": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "tools": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "description": {
                                  "type": "string"
                                },
                                "method": {
                                  "default": "POST",
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "POST",
                                    "PUT",
                                    "PATCH",
                                    "DELETE"
                                  ]
                                },
                                "path": {
                                  "type": "string"
                                },
                                "inputSchema": {},
                                "outputSchema": {}
                              },
                              "required": [
                                "name",
                                "path",
                                "inputSchema"
                              ]
                            }
                          },
                          "auth": {
                            "type": "object",
                            "properties": {
                              "in": {
                                "type": "string",
                                "enum": [
                                  "header",
                                  "query"
                                ]
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "scheme": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "in",
                              "name"
                            ]
                          },
                          "oauth2": {
                            "type": "object",
                            "properties": {
                              "tokenUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "tokenUrl"
                            ]
                          },
                          "hmac": {
                            "type": "object",
                            "properties": {
                              "algorithm": {
                                "default": "sha256",
                                "type": "string",
                                "enum": [
                                  "sha256",
                                  "sha512"
                                ]
                              },
                              "encoding": {
                                "default": "hex",
                                "type": "string",
                                "enum": [
                                  "hex",
                                  "base64"
                                ]
                              },
                              "signatureHeader": {
                                "type": "string",
                                "minLength": 1
                              },
                              "signedComponents": {
                                "minItems": 1,
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "timestamp",
                                    "method",
                                    "path",
                                    "query",
                                    "body"
                                  ]
                                }
                              },
                              "separator": {
                                "type": "string"
                              },
                              "timestampHeader": {
                                "type": "string",
                                "minLength": 1
                              },
                              "signaturePrefix": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "signatureHeader",
                              "signedComponents"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "baseUrl"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "webhook_outbound"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "signingSecretRef": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "url"
                        ]
                      }
                    ]
                  },
                  "basePolicy": {
                    "type": "object",
                    "properties": {
                      "trustBoundary": {
                        "type": "string",
                        "enum": [
                          "local",
                          "tenant_private",
                          "external_remote"
                        ]
                      },
                      "allowedAgentIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allowedToolNames": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "rateLimitPerMinute": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "budgetCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connector": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "mcp_server",
                                "http_endpoint",
                                "webhook_outbound"
                              ]
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "errored"
                              ]
                            },
                            "endpointConfig": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "mcp_server"
                                    },
                                    "transport": {
                                      "type": "string",
                                      "enum": [
                                        "streamable_http"
                                      ]
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "serverSlug": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "apiKeyHeaderName": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url",
                                    "serverSlug"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "http_endpoint"
                                    },
                                    "baseUrl": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "defaultHeaders": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "tools": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "description": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "default": "POST",
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "PUT",
                                              "PATCH",
                                              "DELETE"
                                            ]
                                          },
                                          "path": {
                                            "type": "string"
                                          },
                                          "inputSchema": {},
                                          "outputSchema": {}
                                        },
                                        "required": [
                                          "name",
                                          "method",
                                          "path",
                                          "inputSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "auth": {
                                      "type": "object",
                                      "properties": {
                                        "in": {
                                          "type": "string",
                                          "enum": [
                                            "header",
                                            "query"
                                          ]
                                        },
                                        "name": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scheme": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "in",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "oauth2": {
                                      "type": "object",
                                      "properties": {
                                        "tokenUrl": {
                                          "type": "string",
                                          "format": "uri"
                                        },
                                        "scopes": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "tokenUrl"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "hmac": {
                                      "type": "object",
                                      "properties": {
                                        "algorithm": {
                                          "default": "sha256",
                                          "type": "string",
                                          "enum": [
                                            "sha256",
                                            "sha512"
                                          ]
                                        },
                                        "encoding": {
                                          "default": "hex",
                                          "type": "string",
                                          "enum": [
                                            "hex",
                                            "base64"
                                          ]
                                        },
                                        "signatureHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signedComponents": {
                                          "minItems": 1,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "enum": [
                                              "timestamp",
                                              "method",
                                              "path",
                                              "query",
                                              "body"
                                            ]
                                          }
                                        },
                                        "separator": {
                                          "type": "string"
                                        },
                                        "timestampHeader": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "signaturePrefix": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "algorithm",
                                        "encoding",
                                        "signatureHeader",
                                        "signedComponents"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "baseUrl",
                                    "tools"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "webhook_outbound"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "signingSecretRef": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "basePolicy": {
                              "type": "object",
                              "properties": {
                                "trustBoundary": {
                                  "type": "string",
                                  "enum": [
                                    "local",
                                    "tenant_private",
                                    "external_remote"
                                  ]
                                },
                                "allowedAgentIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "allowedToolNames": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rateLimitPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "budgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "additionalProperties": false
                            },
                            "metadata": {},
                            "lastErrorAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastError": {
                              "type": "string"
                            },
                            "deletedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "kind",
                            "displayName",
                            "state",
                            "endpointConfig",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "connector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Connector_delete",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors/{connectorId}/credential": {
      "get": {
        "operationId": "Connector_getCredential",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "credential": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "oauth_token",
                                "api_key",
                                "basic_auth",
                                "none"
                              ]
                            },
                            "scopes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "active": {
                              "type": "boolean"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "rotatesAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "connectorId",
                            "kind",
                            "scopes",
                            "active"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "Connector_putCredential",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "oauth_token",
                      "api_key",
                      "basic_auth"
                    ]
                  },
                  "token": {
                    "type": "string",
                    "minLength": 1
                  },
                  "refreshToken": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "rotatesAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  }
                },
                "required": [
                  "kind",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "credential": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "oauth_token",
                                "api_key",
                                "basic_auth",
                                "none"
                              ]
                            },
                            "scopes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "active": {
                              "type": "boolean"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "rotatesAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "connectorId",
                            "kind",
                            "scopes",
                            "active"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Connector_deleteCredential",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors/{connectorId}/tools": {
      "get": {
        "operationId": "Connector_listTools",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "connectorId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "inputSchema": {
                                "$ref": "#/$defs/__schema0"
                              },
                              "outputSchema": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            "required": [
                              "name",
                              "inputSchema"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "connectorId",
                        "tools"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors/{connectorId}/connect": {
      "post": {
        "operationId": "Connector_connect",
        "tags": [
          "Connector"
        ],
        "parameters": [
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "authUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "authUrl"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/connectors/import-openapi": {
      "post": {
        "operationId": "Connector_importOpenApi",
        "tags": [
          "Connector"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spec": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "spec"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "baseUrl": {
                          "type": "string"
                        },
                        "tools": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "method": {
                                "default": "POST",
                                "type": "string",
                                "enum": [
                                  "GET",
                                  "POST",
                                  "PUT",
                                  "PATCH",
                                  "DELETE"
                                ]
                              },
                              "path": {
                                "type": "string"
                              },
                              "inputSchema": {},
                              "outputSchema": {}
                            },
                            "required": [
                              "name",
                              "method",
                              "path",
                              "inputSchema"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "tools",
                        "warnings"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/connectors": {
      "get": {
        "operationId": "AgentConnectorBinding_list",
        "tags": [
          "AgentConnectorBinding"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "bindings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "connectorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "enabledTools": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "toolPolicies": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "always"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "never"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "require_approval"
                                        },
                                        "approverPrompt": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "max_calls_per_run"
                                        },
                                        "limit": {
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "limit"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "tenantId",
                              "agentId",
                              "connectorId",
                              "enabledTools",
                              "toolPolicies",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "bindings"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "AgentConnectorBinding_attach",
        "tags": [
          "AgentConnectorBinding"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "connectorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabledTools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "toolPolicies": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "always"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "never"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "require_approval"
                            },
                            "approverPrompt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "max_calls_per_run"
                            },
                            "limit": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "type",
                            "limit"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "connectorId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "binding": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "enabledTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "toolPolicies": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "always"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "never"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "require_approval"
                                      },
                                      "approverPrompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "max_calls_per_run"
                                      },
                                      "limit": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "limit"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "agentId",
                            "connectorId",
                            "enabledTools",
                            "toolPolicies",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "binding"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/connectors/{connectorId}": {
      "patch": {
        "operationId": "AgentConnectorBinding_update",
        "tags": [
          "AgentConnectorBinding"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabledTools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "toolPolicies": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "always"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "never"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "require_approval"
                            },
                            "approverPrompt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "max_calls_per_run"
                            },
                            "limit": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "type",
                            "limit"
                          ]
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "enabledTools"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "binding": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "enabledTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "toolPolicies": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "always"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "never"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "require_approval"
                                      },
                                      "approverPrompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "max_calls_per_run"
                                      },
                                      "limit": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "limit"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "agentId",
                            "connectorId",
                            "enabledTools",
                            "toolPolicies",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "binding"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "AgentConnectorBinding_detach",
        "tags": [
          "AgentConnectorBinding"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "connectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "detached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "detached"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/conversations": {
      "get": {
        "operationId": "Conversation_list",
        "tags": [
          "Conversation"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "deleted"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "title": {
                                "type": "string"
                              },
                              "titleAutoGenerated": {
                                "type": "boolean"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "archived",
                                  "deleted"
                                ]
                              },
                              "lastRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "lastActiveAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "participantUserIds": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "metadata": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "title",
                              "titleAutoGenerated",
                              "state",
                              "createdByUserId",
                              "participantUserIds",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "conversations"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Conversation_create",
        "tags": [
          "Conversation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "titleAutoGenerated": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversation": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "titleAutoGenerated": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "archived",
                                "deleted"
                              ]
                            },
                            "lastRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lastActiveAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "participantUserIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "titleAutoGenerated",
                            "state",
                            "createdByUserId",
                            "participantUserIds",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "conversation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/conversations/{id}": {
      "get": {
        "operationId": "Conversation_get",
        "tags": [
          "Conversation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversation": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "titleAutoGenerated": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "archived",
                                "deleted"
                              ]
                            },
                            "lastRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lastActiveAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "participantUserIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "titleAutoGenerated",
                            "state",
                            "createdByUserId",
                            "participantUserIds",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "runs": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "pending"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "active"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "closed"
                                  },
                                  "output": {}
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "failed"
                                  },
                                  "failureReason": {
                                    "type": "string"
                                  },
                                  "failureCategory": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "invariant_violation",
                                      "unhandled_exception",
                                      "dependency_unavailable"
                                    ]
                                  },
                                  "failureDetail": {}
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state",
                                  "failureReason",
                                  "failureCategory"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "abandoned"
                                  },
                                  "abandonReason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state",
                                  "abandonReason"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "conversation",
                        "runs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Conversation_update",
        "tags": [
          "Conversation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived",
                      "deleted"
                    ]
                  },
                  "addParticipantUserId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversation": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "titleAutoGenerated": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "archived",
                                "deleted"
                              ]
                            },
                            "lastRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lastActiveAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "participantUserIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "titleAutoGenerated",
                            "state",
                            "createdByUserId",
                            "participantUserIds",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "conversation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Conversation_delete",
        "tags": [
          "Conversation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversation": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "titleAutoGenerated": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "archived",
                                "deleted"
                              ]
                            },
                            "lastRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lastActiveAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "participantUserIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "titleAutoGenerated",
                            "state",
                            "createdByUserId",
                            "participantUserIds",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "conversation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/conversations/{id}/runs": {
      "get": {
        "operationId": "Conversation_listRuns",
        "tags": [
          "Conversation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "runs": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "pending"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "active"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "closed"
                                  },
                                  "output": {}
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "failed"
                                  },
                                  "failureReason": {
                                    "type": "string"
                                  },
                                  "failureCategory": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "invariant_violation",
                                      "unhandled_exception",
                                      "dependency_unavailable"
                                    ]
                                  },
                                  "failureDetail": {}
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state",
                                  "failureReason",
                                  "failureCategory"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    ]
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "spawnedByTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "conversationId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "evalRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "replayOfRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "goalId": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "messageCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "closePolicy": {
                                    "type": "string",
                                    "enum": [
                                      "explicit",
                                      "auto_on_idle",
                                      "auto_on_parent_delivery"
                                    ]
                                  },
                                  "wakePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "manual": {
                                        "type": "boolean"
                                      },
                                      "schedules": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "cron": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deliveryPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "latest",
                                                "all",
                                                "count_only"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "cron",
                                            "deliveryPolicy"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "events": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "eventName": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "matchKey": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "eventName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "manual",
                                      "schedules",
                                      "events"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "resourcePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "behavioral": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      },
                                      "reference": {
                                        "type": "string",
                                        "enum": [
                                          "pin_on_run_start",
                                          "follow_latest_on_turn_start"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "behavioral",
                                      "reference"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "runtimePolicy": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "behaviorSnapshot": {
                                    "type": "object",
                                    "properties": {
                                      "agentPromptVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "pinnedSkills": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "executionMode": {
                                              "type": "string",
                                              "enum": [
                                                "prompt",
                                                "code"
                                              ]
                                            },
                                            "allowedTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "body": {
                                              "type": "string"
                                            },
                                            "bundleRef": {
                                              "type": "string"
                                            },
                                            "bundleHash": {
                                              "type": "string"
                                            },
                                            "metadata": {}
                                          },
                                          "required": [
                                            "skillVersionId",
                                            "executionMode",
                                            "metadata"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "skillPolicies": {},
                                      "model": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "provider": {
                                            "type": "string"
                                          },
                                          "params": {},
                                          "temperature": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 2
                                          },
                                          "reasoning": {
                                            "type": "string",
                                            "enum": [
                                              "off",
                                              "low",
                                              "medium",
                                              "high",
                                              "xhigh",
                                              "max"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "params"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "modelRoutingPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptTemplate": {
                                        "type": "string"
                                      },
                                      "systemPromptTemplateHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "toolCatalogHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "harness": {
                                        "type": "object",
                                        "properties": {
                                          "version": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "scoringVersion": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "version",
                                          "scoringVersion"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "goalVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "corpusVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputSchema": {},
                                      "packId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "packBindings": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "requirementKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "packBindingId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "targetKind": {
                                              "type": "string",
                                              "enum": [
                                                "connector",
                                                "corpus"
                                              ]
                                            },
                                            "targetId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "enabledTools": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "policyOverrides": {}
                                          },
                                          "required": [
                                            "requirementKey",
                                            "packBindingId",
                                            "targetKind",
                                            "targetId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "pinnedSkills",
                                      "skillPolicies",
                                      "model",
                                      "systemPromptTemplate",
                                      "systemPromptTemplateHash",
                                      "toolCatalogHash",
                                      "harness",
                                      "closePolicy",
                                      "wakePolicy",
                                      "resourcePolicy",
                                      "runtimePolicy",
                                      "budgetPolicy",
                                      "packBindings"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "shareToken": {
                                    "type": "string"
                                  },
                                  "shareExpiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "artifactVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "artifactVersionId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "pinnedVersions": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "waitingOnUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceBranchId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "workspaceOwnershipKind": {
                                    "type": "string",
                                    "enum": [
                                      "auto_created",
                                      "user_specified",
                                      "inherited_from_parent"
                                    ]
                                  },
                                  "executionRuntimeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceModeDerived": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "archivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "deletedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "state": {
                                    "type": "string",
                                    "const": "abandoned"
                                  },
                                  "abandonReason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "title",
                                  "actorKind",
                                  "actorId",
                                  "messageCount",
                                  "tokensUsed",
                                  "costCentsUsed",
                                  "executionRuntimeDerived",
                                  "workspaceModeDerived",
                                  "createdAt",
                                  "updatedAt",
                                  "state",
                                  "abandonReason"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "runs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/coordinator/session": {
      "get": {
        "operationId": "Coordinator_session",
        "tags": [
          "Coordinator"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agentName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string",
                              "minLength": 1
                            },
                            "initializedAt": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "tenantId",
                            "userId"
                          ],
                          "additionalProperties": false
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant"
                                ]
                              },
                              "text": {
                                "type": "string"
                              },
                              "toolNames": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "role",
                              "text"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "focusedAgents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "modelId": {
                                "type": "string"
                              },
                              "runtimeHint": {
                                "type": "string"
                              },
                              "workspaceMode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "delegatedWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "task": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "delegationReason": {
                                "type": "string"
                              },
                              "initiatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessageId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessagePreview": {
                                "type": "string"
                              },
                              "viewerRole": {
                                "type": "string"
                              },
                              "canInterrupt": {
                                "type": "boolean"
                              },
                              "canResume": {
                                "type": "boolean"
                              },
                              "childRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "openChildRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "workspaceBranchId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "runId",
                              "agentId",
                              "agentName",
                              "runTitle",
                              "runState",
                              "task",
                              "initiatedAt",
                              "canInterrupt",
                              "canResume",
                              "childRunCount",
                              "openChildRunCount",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "inbox": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskStatus": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitDeadlineAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitTimeoutPolicy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "canRespond": {
                                "type": "boolean"
                              },
                              "isClaimedByCurrentUser": {
                                "type": "boolean"
                              },
                              "claimedByAnotherUser": {
                                "type": "boolean"
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "approval"
                                      },
                                      "proposedActionSummary": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "approvalSubject": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "skill_activation"
                                              },
                                              "skillHandle": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "input": {},
                                                  "artifactIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "context": {}
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "skillHandle",
                                              "skillId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "tool_activation"
                                              },
                                              "toolName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "connectorId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "args": {}
                                                },
                                                "required": [
                                                  "args"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "toolName",
                                              "connectorId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "proposedActionSummary"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "selection"
                                      },
                                      "options": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "label"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "allowMultiple": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "options"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "freeform"
                                      },
                                      "responseHint": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "structured"
                                      },
                                      "responseSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "responseSchema"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "taskId",
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "taskStatus",
                              "createdAt",
                              "updatedAt",
                              "canRespond",
                              "isClaimedByCurrentUser",
                              "claimedByAnotherUser",
                              "request"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "openWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "pendingDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingExternalDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "deadLetteredDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "latestDeliveryReceivedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "requiresAttention": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "pendingDeliveryCount",
                              "pendingExternalDeliveryCount",
                              "deadLetteredDeliveryCount",
                              "requiresAttention"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workflowHealth": {
                          "type": "object",
                          "properties": {
                            "waitingOnHumanCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "deadLetteredDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "runsNeedingAttentionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "waitingOnHumanCount",
                            "pendingDeliveryCount",
                            "deadLetteredDeliveryCount",
                            "runsNeedingAttentionCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agentName",
                        "identity",
                        "messages",
                        "focusedAgents",
                        "delegatedWork",
                        "inbox",
                        "openWork",
                        "workflowHealth"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/coordinator/messages": {
      "post": {
        "operationId": "Coordinator_sendMessage",
        "tags": [
          "Coordinator"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20000
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agentName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string",
                              "minLength": 1
                            },
                            "initializedAt": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "tenantId",
                            "userId"
                          ],
                          "additionalProperties": false
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant"
                                ]
                              },
                              "text": {
                                "type": "string"
                              },
                              "toolNames": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "role",
                              "text"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "focusedAgents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "modelId": {
                                "type": "string"
                              },
                              "runtimeHint": {
                                "type": "string"
                              },
                              "workspaceMode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "delegatedWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "task": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "delegationReason": {
                                "type": "string"
                              },
                              "initiatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessageId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessagePreview": {
                                "type": "string"
                              },
                              "viewerRole": {
                                "type": "string"
                              },
                              "canInterrupt": {
                                "type": "boolean"
                              },
                              "canResume": {
                                "type": "boolean"
                              },
                              "childRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "openChildRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "workspaceBranchId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "runId",
                              "agentId",
                              "agentName",
                              "runTitle",
                              "runState",
                              "task",
                              "initiatedAt",
                              "canInterrupt",
                              "canResume",
                              "childRunCount",
                              "openChildRunCount",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "inbox": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskStatus": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitDeadlineAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitTimeoutPolicy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "canRespond": {
                                "type": "boolean"
                              },
                              "isClaimedByCurrentUser": {
                                "type": "boolean"
                              },
                              "claimedByAnotherUser": {
                                "type": "boolean"
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "approval"
                                      },
                                      "proposedActionSummary": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "approvalSubject": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "skill_activation"
                                              },
                                              "skillHandle": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "input": {},
                                                  "artifactIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "context": {}
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "skillHandle",
                                              "skillId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "tool_activation"
                                              },
                                              "toolName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "connectorId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "args": {}
                                                },
                                                "required": [
                                                  "args"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "toolName",
                                              "connectorId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "proposedActionSummary"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "selection"
                                      },
                                      "options": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "label"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "allowMultiple": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "options"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "freeform"
                                      },
                                      "responseHint": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "structured"
                                      },
                                      "responseSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "responseSchema"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "taskId",
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "taskStatus",
                              "createdAt",
                              "updatedAt",
                              "canRespond",
                              "isClaimedByCurrentUser",
                              "claimedByAnotherUser",
                              "request"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "openWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "pendingDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingExternalDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "deadLetteredDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "latestDeliveryReceivedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "requiresAttention": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "pendingDeliveryCount",
                              "pendingExternalDeliveryCount",
                              "deadLetteredDeliveryCount",
                              "requiresAttention"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workflowHealth": {
                          "type": "object",
                          "properties": {
                            "waitingOnHumanCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "deadLetteredDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "runsNeedingAttentionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "waitingOnHumanCount",
                            "pendingDeliveryCount",
                            "deadLetteredDeliveryCount",
                            "runsNeedingAttentionCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agentName",
                        "identity",
                        "messages",
                        "focusedAgents",
                        "delegatedWork",
                        "inbox",
                        "openWork",
                        "workflowHealth"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/coordinator/inbox/respond": {
      "post": {
        "operationId": "Coordinator_respondToInboxItem",
        "tags": [
          "Coordinator"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "taskId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "response": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "approval"
                          },
                          "decision": {
                            "type": "string",
                            "enum": [
                              "approved",
                              "rejected"
                            ]
                          },
                          "note": {
                            "type": "string",
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "decision"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "selection"
                          },
                          "optionIds": {
                            "minItems": 1,
                            "maxItems": 50,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "note": {
                            "type": "string",
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "optionIds"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "freeform"
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "text"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "structured"
                          },
                          "value": {}
                        },
                        "required": [
                          "kind",
                          "value"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "runId",
                  "taskId",
                  "response"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agentName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string",
                              "minLength": 1
                            },
                            "initializedAt": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "tenantId",
                            "userId"
                          ],
                          "additionalProperties": false
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant"
                                ]
                              },
                              "text": {
                                "type": "string"
                              },
                              "toolNames": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "role",
                              "text"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "focusedAgents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "modelId": {
                                "type": "string"
                              },
                              "runtimeHint": {
                                "type": "string"
                              },
                              "workspaceMode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "delegatedWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "task": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "delegationReason": {
                                "type": "string"
                              },
                              "initiatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessageId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceUserMessagePreview": {
                                "type": "string"
                              },
                              "viewerRole": {
                                "type": "string"
                              },
                              "canInterrupt": {
                                "type": "boolean"
                              },
                              "canResume": {
                                "type": "boolean"
                              },
                              "childRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "openChildRunCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "workspaceBranchId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "runId",
                              "agentId",
                              "agentName",
                              "runTitle",
                              "runState",
                              "task",
                              "initiatedAt",
                              "canInterrupt",
                              "canResume",
                              "childRunCount",
                              "openChildRunCount",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "inbox": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskStatus": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitDeadlineAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitTimeoutPolicy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "canRespond": {
                                "type": "boolean"
                              },
                              "isClaimedByCurrentUser": {
                                "type": "boolean"
                              },
                              "claimedByAnotherUser": {
                                "type": "boolean"
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "approval"
                                      },
                                      "proposedActionSummary": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "approvalSubject": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "skill_activation"
                                              },
                                              "skillHandle": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "input": {},
                                                  "artifactIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "context": {}
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "skillHandle",
                                              "skillId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "tool_activation"
                                              },
                                              "toolName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "connectorId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "args": {}
                                                },
                                                "required": [
                                                  "args"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "toolName",
                                              "connectorId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "proposedActionSummary"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "selection"
                                      },
                                      "options": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "label"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "allowMultiple": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "options"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "freeform"
                                      },
                                      "responseHint": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "structured"
                                      },
                                      "responseSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "responseSchema"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "taskId",
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "taskStatus",
                              "createdAt",
                              "updatedAt",
                              "canRespond",
                              "isClaimedByCurrentUser",
                              "claimedByAnotherUser",
                              "request"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "openWork": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "pendingDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingExternalDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "deadLetteredDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "latestDeliveryReceivedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "requiresAttention": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "pendingDeliveryCount",
                              "pendingExternalDeliveryCount",
                              "deadLetteredDeliveryCount",
                              "requiresAttention"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workflowHealth": {
                          "type": "object",
                          "properties": {
                            "waitingOnHumanCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "deadLetteredDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "runsNeedingAttentionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "waitingOnHumanCount",
                            "pendingDeliveryCount",
                            "deadLetteredDeliveryCount",
                            "runsNeedingAttentionCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agentName",
                        "identity",
                        "messages",
                        "focusedAgents",
                        "delegatedWork",
                        "inbox",
                        "openWork",
                        "workflowHealth"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora": {
      "get": {
        "operationId": "Corpus_list",
        "tags": [
          "Corpus"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "corpora": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "slug",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "corpora"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Corpus_create",
        "tags": [
          "Corpus"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "slug",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "corpus": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "corpus"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}": {
      "get": {
        "operationId": "Corpus_get",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "corpus": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "artifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "nameSlug": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "producedByRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "memberPaths": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "artifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "folderPath": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "artifactId",
                              "folderPath"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "folderIncludes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "folderId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "position": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "folderId",
                              "name",
                              "slug",
                              "position"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "versionCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "latestVersion": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "memberCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "memberCount",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "provider": {
                                "type": "string",
                                "enum": [
                                  "google_docs",
                                  "notion",
                                  "confluence",
                                  "url"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "error",
                                  "pending_auth"
                                ]
                              },
                              "lastSyncAt": {
                                "type": "string"
                              },
                              "lastSyncError": {
                                "type": "string"
                              },
                              "scope": {
                                "type": "string",
                                "enum": [
                                  "org",
                                  "user"
                                ]
                              },
                              "syncIntervalMs": {
                                "type": "number"
                              },
                              "accountEmail": {
                                "type": "string"
                              },
                              "artifactCount": {
                                "type": "number"
                              },
                              "canPromote": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "provider",
                              "name",
                              "status",
                              "scope"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "corpus",
                        "artifacts",
                        "memberPaths",
                        "folderIncludes",
                        "versionCount",
                        "sources"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Corpus_delete",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}/artifacts/{artifactId}": {
      "delete": {
        "operationId": "Corpus_unlinkArtifact",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "unlinked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unlinked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "Corpus_linkArtifact",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "linked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "linked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}/order": {
      "put": {
        "operationId": "Corpus_reorder",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "artifactIds": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "artifactIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "reordered": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "reordered"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}/build-brain": {
      "post": {
        "operationId": "Corpus_buildBrain",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "targetCorpusSlug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
                  },
                  "targetCorpusName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "knowledgeGraphName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "documentSlugs": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "targetCorpusSlug"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "buildBrain": {
                          "type": "object",
                          "properties": {
                            "jobId": {
                              "type": "string"
                            },
                            "sourceCorpusId": {
                              "type": "string"
                            },
                            "targetCorpusSlug": {
                              "type": "string"
                            },
                            "documentsSelected": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "status": {
                              "type": "string",
                              "const": "scheduled"
                            }
                          },
                          "required": [
                            "jobId",
                            "sourceCorpusId",
                            "targetCorpusSlug",
                            "documentsSelected",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "buildBrain"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}/build-brain/{jobId}": {
      "get": {
        "operationId": "Corpus_buildBrainJobStatus",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "jobId": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "scheduled",
                            "running",
                            "succeeded",
                            "failed"
                          ]
                        },
                        "sourceCorpusId": {
                          "type": "string"
                        },
                        "targetCorpusSlug": {
                          "type": "string"
                        },
                        "documentsSelected": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "knowledgeGraphId": {
                          "type": "string"
                        },
                        "targetCorpusId": {
                          "type": "string"
                        },
                        "nodeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "edgeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "error": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "jobId",
                        "status",
                        "sourceCorpusId",
                        "targetCorpusSlug",
                        "documentsSelected"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/corpora/{slug}/folders/{folderId}": {
      "put": {
        "operationId": "Corpus_linkFolder",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          },
          {
            "name": "folderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "linked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "linked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Corpus_unlinkFolder",
        "tags": [
          "Corpus"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9]))*$"
            }
          },
          {
            "name": "folderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "unlinked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unlinked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/runs": {
      "get": {
        "operationId": "Eval_listByGoal",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "runs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "completed",
                                  "failed"
                                ]
                              },
                              "configSnapshot": {},
                              "goalVersionId": {
                                "type": "string"
                              },
                              "corpusVersionId": {
                                "type": "string"
                              },
                              "aggregateScore": {
                                "type": "number"
                              },
                              "dimensionScores": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "number"
                                }
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "synthetic",
                                  "production",
                                  "auto_trigger",
                                  "pairwise",
                                  "changeset"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "status",
                              "source",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "runs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Eval_create",
        "tags": [
          "Eval"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "goalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "corpusVersionId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "goalId",
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "evalRun": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "configSnapshot": {},
                            "goalVersionId": {
                              "type": "string"
                            },
                            "corpusVersionId": {
                              "type": "string"
                            },
                            "aggregateScore": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "synthetic",
                                "production",
                                "auto_trigger",
                                "pairwise",
                                "changeset"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "evalRun"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/recent-runs": {
      "get": {
        "operationId": "Eval_listRecent",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "runs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "evalRun": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "completed",
                                      "failed"
                                    ]
                                  },
                                  "configSnapshot": {},
                                  "goalVersionId": {
                                    "type": "string"
                                  },
                                  "corpusVersionId": {
                                    "type": "string"
                                  },
                                  "aggregateScore": {
                                    "type": "number"
                                  },
                                  "dimensionScores": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "number"
                                    }
                                  },
                                  "source": {
                                    "type": "string",
                                    "enum": [
                                      "synthetic",
                                      "production",
                                      "auto_trigger",
                                      "pairwise",
                                      "changeset"
                                    ]
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "status",
                                  "source",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "goalId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "goalName": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "evalRun"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "runs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/runs/{evalRunId}": {
      "get": {
        "operationId": "Eval_get",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "evalRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "configSnapshot": {},
                            "goalVersionId": {
                              "type": "string"
                            },
                            "corpusVersionId": {
                              "type": "string"
                            },
                            "aggregateScore": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "synthetic",
                                "production",
                                "auto_trigger",
                                "pairwise",
                                "changeset"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "changeSetItemId": {
                                "type": "string"
                              },
                              "method": {
                                "default": "automated",
                                "type": "string",
                                "enum": [
                                  "automated",
                                  "human",
                                  "summarized"
                                ]
                              },
                              "score": {
                                "type": "number"
                              },
                              "dimensionScores": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "number"
                                }
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "humanFeedback": {
                                "type": "string",
                                "enum": [
                                  "positive",
                                  "negative"
                                ]
                              },
                              "summaryHash": {
                                "type": "string"
                              },
                              "winner": {
                                "type": "string",
                                "enum": [
                                  "a_better",
                                  "b_better",
                                  "tie"
                                ]
                              },
                              "comparedVersionHash": {
                                "type": "string"
                              },
                              "outputOrder": {
                                "type": "string",
                                "enum": [
                                  "current_first",
                                  "draft_first"
                                ]
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "tenantId",
                              "method",
                              "id",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "run",
                        "results"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/runs/{evalRunId}/results": {
      "post": {
        "operationId": "Eval_recordResult",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "evalRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "goalCaseId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "score": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dimensionScores": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "reasoning": {
                    "type": "string"
                  }
                },
                "required": [
                  "goalCaseId",
                  "score"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "changeSetItemId": {
                              "type": "string"
                            },
                            "method": {
                              "default": "automated",
                              "type": "string",
                              "enum": [
                                "automated",
                                "human",
                                "summarized"
                              ]
                            },
                            "score": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "reasoning": {
                              "type": "string"
                            },
                            "humanFeedback": {
                              "type": "string",
                              "enum": [
                                "positive",
                                "negative"
                              ]
                            },
                            "summaryHash": {
                              "type": "string"
                            },
                            "winner": {
                              "type": "string",
                              "enum": [
                                "a_better",
                                "b_better",
                                "tie"
                              ]
                            },
                            "comparedVersionHash": {
                              "type": "string"
                            },
                            "outputOrder": {
                              "type": "string",
                              "enum": [
                                "current_first",
                                "draft_first"
                              ]
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "method",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "result"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/runs/{evalRunId}/complete": {
      "post": {
        "operationId": "Eval_completeRun",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "evalRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "evalRun": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "configSnapshot": {},
                            "goalVersionId": {
                              "type": "string"
                            },
                            "corpusVersionId": {
                              "type": "string"
                            },
                            "aggregateScore": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "synthetic",
                                "production",
                                "auto_trigger",
                                "pairwise",
                                "changeset"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "evalRun"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/trigger": {
      "post": {
        "operationId": "Eval_trigger",
        "tags": [
          "Eval"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "goalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "corpusVersionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reflect": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "goalId",
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "evalRun": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "configSnapshot": {},
                            "goalVersionId": {
                              "type": "string"
                            },
                            "corpusVersionId": {
                              "type": "string"
                            },
                            "aggregateScore": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "synthetic",
                                "production",
                                "auto_trigger",
                                "pairwise",
                                "changeset"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "evalRun",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/runs/{evalRunId}/cancel": {
      "post": {
        "operationId": "Eval_cancelRun",
        "tags": [
          "Eval"
        ],
        "parameters": [
          {
            "name": "evalRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "evalRun": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                              ]
                            },
                            "configSnapshot": {},
                            "goalVersionId": {
                              "type": "string"
                            },
                            "corpusVersionId": {
                              "type": "string"
                            },
                            "aggregateScore": {
                              "type": "number"
                            },
                            "dimensionScores": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "number"
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "synthetic",
                                "production",
                                "auto_trigger",
                                "pairwise",
                                "changeset"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "status",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "evalRun"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/evals/score-recent": {
      "post": {
        "operationId": "Eval_scoreRecent",
        "tags": [
          "Eval"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "goalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  }
                },
                "required": [
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "dispatched": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "totalCompleted": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dispatched",
                        "totalCompleted",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals": {
      "get": {
        "operationId": "Goal_list",
        "tags": [
          "Goal"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "goals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "rubric": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "dimension": {
                                      "type": "string"
                                    },
                                    "criteria": {
                                      "type": "string"
                                    },
                                    "weight": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "dimension",
                                    "criteria",
                                    "weight"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "archived"
                                ]
                              },
                              "dailyEvalBudget": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "productionEvalBudget": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "rubric",
                              "status",
                              "dailyEvalBudget",
                              "productionEvalBudget",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "goals"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Goal_create",
        "tags": [
          "Goal"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "rubric": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string",
                          "minLength": 1
                        },
                        "criteria": {
                          "type": "string",
                          "minLength": 1
                        },
                        "weight": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        }
                      },
                      "required": [
                        "dimension",
                        "criteria",
                        "weight"
                      ]
                    }
                  },
                  "cases": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "input": {},
                        "expectedOutput": {},
                        "sortOrder": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "generated",
                            "distilled"
                          ]
                        },
                        "sourceRunMessageIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string"
                              },
                              "turns": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "enum": [
                                        "user",
                                        "assistant"
                                      ]
                                    },
                                    "runMessageId": {
                                      "type": "string"
                                    },
                                    "text": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runMessageId",
                                    "text"
                                  ]
                                }
                              },
                              "occurredAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "runId",
                              "turns"
                            ]
                          }
                        },
                        "distillation": {
                          "type": "object",
                          "properties": {
                            "jobId": {
                              "type": "string"
                            },
                            "algorithm": {
                              "type": "string",
                              "enum": [
                                "kmeans",
                                "recursive_decomposition"
                              ]
                            },
                            "algorithmVersion": {
                              "type": "string"
                            },
                            "model": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "traceSampleWindow": {
                              "type": "object",
                              "properties": {
                                "sampleSize": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "earliestOccurredAt": {
                                  "type": "string"
                                },
                                "latestOccurredAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "sampleSize"
                              ]
                            },
                            "distilledAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "jobId",
                            "algorithm",
                            "algorithmVersion",
                            "model",
                            "promptVersion",
                            "traceSampleWindow",
                            "distilledAt"
                          ]
                        }
                      },
                      "required": [
                        "name",
                        "input"
                      ]
                    }
                  },
                  "dailyEvalBudget": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "rubric",
                  "cases"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "goal": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "rubric": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "weight": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "dimension",
                                  "criteria",
                                  "weight"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "archived"
                              ]
                            },
                            "dailyEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "productionEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "rubric",
                            "status",
                            "dailyEvalBudget",
                            "productionEvalBudget",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "goal"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}": {
      "get": {
        "operationId": "Goal_get",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "cases": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "input": {},
                              "expectedOutput": {},
                              "sortOrder": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "manual",
                                  "generated",
                                  "distilled"
                                ]
                              },
                              "sourceRunMessageIds": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "runId": {
                                      "type": "string"
                                    },
                                    "turns": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "enum": [
                                              "user",
                                              "assistant"
                                            ]
                                          },
                                          "runMessageId": {
                                            "type": "string"
                                          },
                                          "text": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "runMessageId",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runId",
                                    "turns"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "distillation": {
                                "type": "object",
                                "properties": {
                                  "jobId": {
                                    "type": "string"
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "enum": [
                                      "kmeans",
                                      "recursive_decomposition"
                                    ]
                                  },
                                  "algorithmVersion": {
                                    "type": "string"
                                  },
                                  "model": {
                                    "type": "string"
                                  },
                                  "promptVersion": {
                                    "type": "string"
                                  },
                                  "traceSampleWindow": {
                                    "type": "object",
                                    "properties": {
                                      "sampleSize": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "earliestOccurredAt": {
                                        "type": "string"
                                      },
                                      "latestOccurredAt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "sampleSize"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "distilledAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "jobId",
                                  "algorithm",
                                  "algorithmVersion",
                                  "model",
                                  "promptVersion",
                                  "traceSampleWindow",
                                  "distilledAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "input",
                              "sortOrder",
                              "source",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "goal": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "rubric": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "weight": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "dimension",
                                  "criteria",
                                  "weight"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "archived"
                              ]
                            },
                            "dailyEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "productionEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "rubric",
                            "status",
                            "dailyEvalBudget",
                            "productionEvalBudget",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "cases",
                        "goal",
                        "agents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Goal_update",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "rubric": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string",
                          "minLength": 1
                        },
                        "criteria": {
                          "type": "string",
                          "minLength": 1
                        },
                        "weight": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        }
                      },
                      "required": [
                        "dimension",
                        "criteria",
                        "weight"
                      ]
                    }
                  },
                  "dailyEvalBudget": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "archived"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "goal": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "rubric": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "weight": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "dimension",
                                  "criteria",
                                  "weight"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "archived"
                              ]
                            },
                            "dailyEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "productionEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "rubric",
                            "status",
                            "dailyEvalBudget",
                            "productionEvalBudget",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "goal"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Goal_delete",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/dashboard": {
      "get": {
        "operationId": "Goal_dashboard",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "scoreTrend": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "evalRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "score": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "dimensionScores": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "number"
                                }
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "source": {
                                "type": "string"
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "evalRunId",
                              "agentId",
                              "score",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "latestScore": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "previousScore": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "scoreDelta": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "runCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingChangeSets": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "agentId",
                              "agentName",
                              "latestScore",
                              "previousScore",
                              "scoreDelta",
                              "runCount",
                              "pendingChangeSets"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "timeline": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "eval_completed",
                                  "changeset_adopted",
                                  "changeset_reverted",
                                  "score_drop",
                                  "score_rise"
                                ]
                              },
                              "timestamp": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "detail": {
                                "type": "string"
                              },
                              "score": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "scoreDelta": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "configSnapshotHash": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "timestamp",
                              "agentId",
                              "detail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "activeRuns": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "evalRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "evalRunId",
                              "agentId",
                              "agentName",
                              "status",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "pendingChangeSets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "adopting",
                                  "adopted",
                                  "reverting",
                                  "reverted",
                                  "rejected",
                                  "dismissed"
                                ]
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "feedback": {
                                "type": "string"
                              },
                              "predictedScore": {
                                "type": "number"
                              },
                              "actualScore": {
                                "type": "number"
                              },
                              "proposalSource": {
                                "type": "string",
                                "enum": [
                                  "reflection",
                                  "nightly_improvement",
                                  "knowledge_capture",
                                  "gardening",
                                  "automation",
                                  "semantic_kernel",
                                  "external_agent"
                                ]
                              },
                              "producingRunId": {
                                "type": "string"
                              },
                              "evidenceRunIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "agentName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "agentVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "externalRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "sources": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "brainMutationBatchId": {
                                "type": "string"
                              },
                              "brainMutationPolicyVersionId": {
                                "type": "string"
                              },
                              "brainMutationReasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenanceTier": {
                                "type": "string",
                                "enum": [
                                  "boundary",
                                  "self_reported",
                                  "instrumented"
                                ]
                              },
                              "evaluationState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "passed",
                                  "warned",
                                  "failed",
                                  "unavailable",
                                  "stale"
                                ]
                              },
                              "evaluationScore": {
                                "type": "number"
                              },
                              "evaluationRunId": {
                                "type": "string"
                              },
                              "evaluationFingerprint": {
                                "type": "string"
                              },
                              "evaluatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "evaluationOverride": {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string"
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "overriddenAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "reason",
                                  "actorKind",
                                  "evaluationState",
                                  "overriddenAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "status",
                              "provenanceTier",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "changeSetHistory": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "adopting",
                                  "adopted",
                                  "reverting",
                                  "reverted",
                                  "rejected",
                                  "dismissed"
                                ]
                              },
                              "reasoning": {
                                "type": "string"
                              },
                              "feedback": {
                                "type": "string"
                              },
                              "predictedScore": {
                                "type": "number"
                              },
                              "actualScore": {
                                "type": "number"
                              },
                              "proposalSource": {
                                "type": "string",
                                "enum": [
                                  "reflection",
                                  "nightly_improvement",
                                  "knowledge_capture",
                                  "gardening",
                                  "automation",
                                  "semantic_kernel",
                                  "external_agent"
                                ]
                              },
                              "producingRunId": {
                                "type": "string"
                              },
                              "evidenceRunIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "agentName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "agentVersion": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "externalRunId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "sources": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "brainMutationBatchId": {
                                "type": "string"
                              },
                              "brainMutationPolicyVersionId": {
                                "type": "string"
                              },
                              "brainMutationReasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "provenanceTier": {
                                "type": "string",
                                "enum": [
                                  "boundary",
                                  "self_reported",
                                  "instrumented"
                                ]
                              },
                              "evaluationState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "passed",
                                  "warned",
                                  "failed",
                                  "unavailable",
                                  "stale"
                                ]
                              },
                              "evaluationScore": {
                                "type": "number"
                              },
                              "evaluationRunId": {
                                "type": "string"
                              },
                              "evaluationFingerprint": {
                                "type": "string"
                              },
                              "evaluatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "evaluationOverride": {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "actorKind": {
                                    "type": "string"
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "overriddenAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "reason",
                                  "actorKind",
                                  "evaluationState",
                                  "overriddenAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "status",
                              "provenanceTier",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "goal": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "rubric": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "weight": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "dimension",
                                  "criteria",
                                  "weight"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "archived"
                              ]
                            },
                            "dailyEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "productionEvalBudget": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "rubric",
                            "status",
                            "dailyEvalBudget",
                            "productionEvalBudget",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "cases": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "input": {},
                              "expectedOutput": {},
                              "sortOrder": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "manual",
                                  "generated",
                                  "distilled"
                                ]
                              },
                              "sourceRunMessageIds": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "runId": {
                                      "type": "string"
                                    },
                                    "turns": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "enum": [
                                              "user",
                                              "assistant"
                                            ]
                                          },
                                          "runMessageId": {
                                            "type": "string"
                                          },
                                          "text": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "runMessageId",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runId",
                                    "turns"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "distillation": {
                                "type": "object",
                                "properties": {
                                  "jobId": {
                                    "type": "string"
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "enum": [
                                      "kmeans",
                                      "recursive_decomposition"
                                    ]
                                  },
                                  "algorithmVersion": {
                                    "type": "string"
                                  },
                                  "model": {
                                    "type": "string"
                                  },
                                  "promptVersion": {
                                    "type": "string"
                                  },
                                  "traceSampleWindow": {
                                    "type": "object",
                                    "properties": {
                                      "sampleSize": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "earliestOccurredAt": {
                                        "type": "string"
                                      },
                                      "latestOccurredAt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "sampleSize"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "distilledAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "jobId",
                                  "algorithm",
                                  "algorithmVersion",
                                  "model",
                                  "promptVersion",
                                  "traceSampleWindow",
                                  "distilledAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "input",
                              "sortOrder",
                              "source",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "scoreTrend",
                        "agents",
                        "timeline",
                        "activeRuns",
                        "pendingChangeSets",
                        "changeSetHistory",
                        "goal",
                        "cases"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/cases": {
      "get": {
        "operationId": "Goal_listCases",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "cases": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "input": {},
                              "expectedOutput": {},
                              "sortOrder": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "manual",
                                  "generated",
                                  "distilled"
                                ]
                              },
                              "sourceRunMessageIds": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "runId": {
                                      "type": "string"
                                    },
                                    "turns": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "enum": [
                                              "user",
                                              "assistant"
                                            ]
                                          },
                                          "runMessageId": {
                                            "type": "string"
                                          },
                                          "text": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "runMessageId",
                                          "text"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runId",
                                    "turns"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "distillation": {
                                "type": "object",
                                "properties": {
                                  "jobId": {
                                    "type": "string"
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "enum": [
                                      "kmeans",
                                      "recursive_decomposition"
                                    ]
                                  },
                                  "algorithmVersion": {
                                    "type": "string"
                                  },
                                  "model": {
                                    "type": "string"
                                  },
                                  "promptVersion": {
                                    "type": "string"
                                  },
                                  "traceSampleWindow": {
                                    "type": "object",
                                    "properties": {
                                      "sampleSize": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "earliestOccurredAt": {
                                        "type": "string"
                                      },
                                      "latestOccurredAt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "sampleSize"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "distilledAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "jobId",
                                  "algorithm",
                                  "algorithmVersion",
                                  "model",
                                  "promptVersion",
                                  "traceSampleWindow",
                                  "distilledAt"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "input",
                              "sortOrder",
                              "source",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "cases"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Goal_addCase",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "input": {},
                  "expectedOutput": {},
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "generated",
                      "distilled"
                    ]
                  },
                  "sourceRunMessageIds": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "runId": {
                          "type": "string"
                        },
                        "turns": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant"
                                ]
                              },
                              "runMessageId": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "role",
                              "runMessageId",
                              "text"
                            ]
                          }
                        },
                        "occurredAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "runId",
                        "turns"
                      ]
                    }
                  },
                  "distillation": {
                    "type": "object",
                    "properties": {
                      "jobId": {
                        "type": "string"
                      },
                      "algorithm": {
                        "type": "string",
                        "enum": [
                          "kmeans",
                          "recursive_decomposition"
                        ]
                      },
                      "algorithmVersion": {
                        "type": "string"
                      },
                      "model": {
                        "type": "string"
                      },
                      "promptVersion": {
                        "type": "string"
                      },
                      "traceSampleWindow": {
                        "type": "object",
                        "properties": {
                          "sampleSize": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "earliestOccurredAt": {
                            "type": "string"
                          },
                          "latestOccurredAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "sampleSize"
                        ]
                      },
                      "distilledAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "jobId",
                      "algorithm",
                      "algorithmVersion",
                      "model",
                      "promptVersion",
                      "traceSampleWindow",
                      "distilledAt"
                    ]
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "case": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "input": {},
                            "expectedOutput": {},
                            "sortOrder": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "generated",
                                "distilled"
                              ]
                            },
                            "sourceRunMessageIds": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string"
                                  },
                                  "turns": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "enum": [
                                            "user",
                                            "assistant"
                                          ]
                                        },
                                        "runMessageId": {
                                          "type": "string"
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "runMessageId",
                                        "text"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "occurredAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "turns"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "distillation": {
                              "type": "object",
                              "properties": {
                                "jobId": {
                                  "type": "string"
                                },
                                "algorithm": {
                                  "type": "string",
                                  "enum": [
                                    "kmeans",
                                    "recursive_decomposition"
                                  ]
                                },
                                "algorithmVersion": {
                                  "type": "string"
                                },
                                "model": {
                                  "type": "string"
                                },
                                "promptVersion": {
                                  "type": "string"
                                },
                                "traceSampleWindow": {
                                  "type": "object",
                                  "properties": {
                                    "sampleSize": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "earliestOccurredAt": {
                                      "type": "string"
                                    },
                                    "latestOccurredAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "sampleSize"
                                  ],
                                  "additionalProperties": false
                                },
                                "distilledAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "jobId",
                                "algorithm",
                                "algorithmVersion",
                                "model",
                                "promptVersion",
                                "traceSampleWindow",
                                "distilledAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "input",
                            "sortOrder",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "case"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/agents": {
      "post": {
        "operationId": "Goal_assignAgent",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "assigned": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "assigned"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "Goal_listAgents",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "agents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/agents/{agentId}": {
      "delete": {
        "operationId": "Goal_removeAgent",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "removed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "removed"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/cases/{caseId}": {
      "patch": {
        "operationId": "Goal_updateCase",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "input": {},
                  "expectedOutput": {},
                  "sortOrder": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "case": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "input": {},
                            "expectedOutput": {},
                            "sortOrder": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "generated",
                                "distilled"
                              ]
                            },
                            "sourceRunMessageIds": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string"
                                  },
                                  "turns": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "enum": [
                                            "user",
                                            "assistant"
                                          ]
                                        },
                                        "runMessageId": {
                                          "type": "string"
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "runMessageId",
                                        "text"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "occurredAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "turns"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "distillation": {
                              "type": "object",
                              "properties": {
                                "jobId": {
                                  "type": "string"
                                },
                                "algorithm": {
                                  "type": "string",
                                  "enum": [
                                    "kmeans",
                                    "recursive_decomposition"
                                  ]
                                },
                                "algorithmVersion": {
                                  "type": "string"
                                },
                                "model": {
                                  "type": "string"
                                },
                                "promptVersion": {
                                  "type": "string"
                                },
                                "traceSampleWindow": {
                                  "type": "object",
                                  "properties": {
                                    "sampleSize": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "earliestOccurredAt": {
                                      "type": "string"
                                    },
                                    "latestOccurredAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "sampleSize"
                                  ],
                                  "additionalProperties": false
                                },
                                "distilledAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "jobId",
                                "algorithm",
                                "algorithmVersion",
                                "model",
                                "promptVersion",
                                "traceSampleWindow",
                                "distilledAt"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "input",
                            "sortOrder",
                            "source",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "case"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Goal_deleteCase",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/goals/{goalId}/cases/{caseId}/label": {
      "post": {
        "operationId": "Goal_labelCase",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "enum": [
                      "good",
                      "bad"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "goalCaseId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "enum": [
                                "good",
                                "bad"
                              ]
                            },
                            "note": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "goalCaseId",
                            "userId",
                            "label",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "Goal_listCaseLabels",
        "tags": [
          "Goal"
        ],
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "goalCaseId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "userId": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string",
                                "enum": [
                                  "good",
                                  "bad"
                                ]
                              },
                              "note": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "goalCaseId",
                              "userId",
                              "label",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "labels"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/human-input/inbox": {
      "get": {
        "operationId": "HumanInput_inbox",
        "tags": [
          "HumanInput"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "mine",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "minLength": 1
                              },
                              "actorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskStatus": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "updatedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitDeadlineAt": {
                                "type": "string",
                                "minLength": 1
                              },
                              "waitTimeoutPolicy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "canRespond": {
                                "type": "boolean"
                              },
                              "isClaimedByCurrentUser": {
                                "type": "boolean"
                              },
                              "claimedByAnotherUser": {
                                "type": "boolean"
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "approval"
                                      },
                                      "proposedActionSummary": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "approvalSubject": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "skill_activation"
                                              },
                                              "skillHandle": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "input": {},
                                                  "artifactIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "context": {}
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "skillHandle",
                                              "skillId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "tool_activation"
                                              },
                                              "toolName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "connectorId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "toolUseId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "request": {
                                                "type": "object",
                                                "properties": {
                                                  "args": {}
                                                },
                                                "required": [
                                                  "args"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "toolName",
                                              "connectorId",
                                              "request"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "proposedActionSummary"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "selection"
                                      },
                                      "options": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "label"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "allowMultiple": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "options"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "freeform"
                                      },
                                      "responseHint": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "relatedArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "allowedResponders": {
                                        "type": "object",
                                        "properties": {
                                          "userIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      },
                                      "requestType": {
                                        "type": "string",
                                        "const": "structured"
                                      },
                                      "responseSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "title",
                                      "prompt",
                                      "relatedArtifactIds",
                                      "allowedResponders",
                                      "timeoutPolicy",
                                      "requestType",
                                      "responseSchema"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "taskId",
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "taskStatus",
                              "createdAt",
                              "updatedAt",
                              "canRespond",
                              "isClaimedByCurrentUser",
                              "claimedByAnotherUser",
                              "request"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import": {
      "post": {
        "operationId": "KnowledgeBundle_import",
        "tags": [
          "KnowledgeBundle"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "manifest": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "canonical-context-bundle"
                      },
                      "bundleVersion": {
                        "type": "string",
                        "const": "1"
                      },
                      "exportedAt": {
                        "type": "string"
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "product": {
                            "type": "string"
                          },
                          "productVersion": {
                            "type": "string"
                          },
                          "organization": {
                            "type": "string"
                          },
                          "project": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "product",
                          "productVersion",
                          "organization",
                          "project"
                        ]
                      },
                      "documents": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1
                            },
                            "docVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1
                            },
                            "filename": {
                              "type": "string",
                              "minLength": 1
                            },
                            "folderSlug": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "nameSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "mimeType": {
                              "type": "string",
                              "minLength": 1
                            },
                            "entryKind": {
                              "type": "string",
                              "enum": [
                                "markdown",
                                "attachment"
                              ]
                            },
                            "sourcePath": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "slug",
                            "title",
                            "docVersion",
                            "contentHash",
                            "filename",
                            "folderSlug"
                          ]
                        }
                      },
                      "folders": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentSlug": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "position": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "slug",
                            "name",
                            "parentSlug",
                            "position"
                          ]
                        }
                      },
                      "contexts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "contextVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "members": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "documentSlug": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "documentVersion": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "contentHash": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "position": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "documentSlug",
                                  "documentVersion",
                                  "contentHash",
                                  "position"
                                ]
                              }
                            }
                          },
                          "required": [
                            "slug",
                            "name",
                            "contextVersion",
                            "members"
                          ]
                        }
                      },
                      "integrity": {
                        "type": "object",
                        "properties": {
                          "algorithm": {
                            "type": "string",
                            "const": "sha256"
                          },
                          "rootHash": {
                            "type": "string",
                            "minLength": 1
                          },
                          "fidelityDigest": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "algorithm",
                          "rootHash"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "bundleVersion",
                      "exportedAt",
                      "source",
                      "documents",
                      "folders",
                      "contexts",
                      "integrity"
                    ]
                  },
                  "documents": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "docVersion": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "contentHash": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "title",
                        "docVersion",
                        "contentHash"
                      ]
                    }
                  },
                  "history": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string",
                            "minLength": 1
                          },
                          "docVersion": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "contentHash": {
                            "type": "string",
                            "minLength": 1
                          },
                          "prevContentHash": {
                            "type": "string",
                            "minLength": 1
                          },
                          "changedAt": {
                            "type": "string"
                          },
                          "changedBy": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "slug",
                          "docVersion",
                          "contentHash"
                        ]
                      }
                    }
                  },
                  "blobs": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "records": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string",
                          "minLength": 1
                        },
                        "kind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "fields": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "versionId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "recordedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "slug",
                        "kind",
                        "fields",
                        "versionId",
                        "recordedAt"
                      ]
                    }
                  },
                  "evidence": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "evidenceId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "versionId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "contentHash": {
                            "type": "string",
                            "minLength": 1
                          },
                          "anchor": {
                            "type": "object",
                            "properties": {
                              "locator": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "fragmentHash": {
                                "type": "string",
                                "minLength": 1
                              },
                              "quote": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "locator",
                              "fragmentHash"
                            ]
                          }
                        },
                        "required": [
                          "evidenceId",
                          "versionId",
                          "contentHash"
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "manifest",
                  "documents",
                  "history",
                  "blobs"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "report": {
                          "type": "object",
                          "properties": {
                            "sourceOrganization": {
                              "type": "string"
                            },
                            "sourceProject": {
                              "type": "string"
                            },
                            "documentsImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "artifactVersionsCreated": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "corporaImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "foldersImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "droppedPrevContentHashCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "rootHashVerified": {
                              "type": "boolean",
                              "const": true
                            }
                          },
                          "required": [
                            "sourceOrganization",
                            "sourceProject",
                            "documentsImported",
                            "artifactVersionsCreated",
                            "corporaImported",
                            "foldersImported",
                            "droppedPrevContentHashCount",
                            "rootHashVerified"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "report"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import-markdown/{jobId}/commit": {
      "post": {
        "operationId": "KnowledgeBundle_importMarkdownCommit",
        "tags": [
          "KnowledgeBundle"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "flavor": {
                    "type": "string",
                    "enum": [
                      "gbrain",
                      "obsidian",
                      "karpathy-generic",
                      "generic"
                    ]
                  },
                  "corpusSlug": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "corpusName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "knowledgeGraphName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "typeMappings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "folder": {
                          "type": "string"
                        },
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "folder",
                        "kind"
                      ]
                    }
                  }
                },
                "required": [
                  "flavor",
                  "corpusSlug",
                  "corpusName",
                  "typeMappings"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "importMarkdown": {
                          "type": "object",
                          "properties": {
                            "jobId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "const": "scheduled"
                            }
                          },
                          "required": [
                            "jobId",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "importMarkdown"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import-markdown/{jobId}": {
      "get": {
        "operationId": "KnowledgeBundle_importMarkdownStatus",
        "tags": [
          "KnowledgeBundle"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "jobId": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "proposed",
                            "scheduled",
                            "running",
                            "succeeded",
                            "partial",
                            "failed",
                            "cancelled"
                          ]
                        },
                        "flavor": {
                          "type": "string",
                          "enum": [
                            "gbrain",
                            "obsidian",
                            "karpathy-generic",
                            "generic"
                          ]
                        },
                        "corpusSlug": {
                          "type": "string"
                        },
                        "proposal": {
                          "type": "object",
                          "properties": {
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "gbrain",
                                "obsidian",
                                "karpathy-generic",
                                "generic"
                              ]
                            },
                            "corpusSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusName": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentFilePresent": {
                              "type": "boolean"
                            },
                            "typeMappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "folder": {
                                    "type": "string"
                                  },
                                  "proposedKind": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "fileCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "typedFileCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "observedTypes": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "count": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "count"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "sampleSlugs": {
                                    "maxItems": 8,
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "folder",
                                  "proposedKind",
                                  "fileCount",
                                  "typedFileCount",
                                  "observedTypes",
                                  "sampleSlugs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edgeFields": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "field": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sampleCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "name",
                                  "field",
                                  "sampleCount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "preview": {
                              "type": "object",
                              "properties": {
                                "documents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "pagesTyped": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "pagesUntyped": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "unclassified": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "path": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "reason": {
                                        "type": "string",
                                        "enum": [
                                          "no_type_or_folder",
                                          "unknown_type",
                                          "malformed_frontmatter"
                                        ]
                                      },
                                      "declaredType": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "path",
                                      "reason"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "linksResolved": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "linksUnresolved": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "foldersDetected": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "nonMarkdownSkipped": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "attachmentsImported": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "unsupportedPaths": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "filesSkipped": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "skippedFiles": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "path": {
                                        "type": "string"
                                      },
                                      "reason": {
                                        "type": "string",
                                        "enum": [
                                          "directory",
                                          "too_large",
                                          "count_limit",
                                          "total_limit",
                                          "unsafe_path"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "path",
                                      "reason"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "documents",
                                "pagesTyped",
                                "pagesUntyped",
                                "unclassified",
                                "linksResolved",
                                "linksUnresolved",
                                "foldersDetected",
                                "nonMarkdownSkipped",
                                "attachmentsImported",
                                "unsupportedPaths",
                                "filesSkipped",
                                "skippedFiles"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "flavor",
                            "corpusSlug",
                            "corpusName",
                            "agentFilePresent",
                            "typeMappings",
                            "edgeFields",
                            "preview"
                          ],
                          "additionalProperties": false
                        },
                        "report": {
                          "type": "object",
                          "properties": {
                            "flavor": {
                              "type": "string",
                              "enum": [
                                "gbrain",
                                "obsidian",
                                "karpathy-generic",
                                "generic"
                              ]
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "sourceCorpusId": {
                              "type": "string"
                            },
                            "documentsImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pagesTyped": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pagesUntyped": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "unclassified": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "reason": {
                                    "type": "string",
                                    "enum": [
                                      "no_type_or_folder",
                                      "unknown_type",
                                      "malformed_frontmatter"
                                    ]
                                  },
                                  "declaredType": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "path",
                                  "reason"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "foldersImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "linksResolved": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "linksUnresolved": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nonMarkdownSkipped": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "attachmentsImported": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "unsupportedPaths": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "filesSkipped": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skippedFiles": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "reason": {
                                    "type": "string",
                                    "enum": [
                                      "directory",
                                      "too_large",
                                      "count_limit",
                                      "total_limit",
                                      "unsafe_path"
                                    ]
                                  }
                                },
                                "required": [
                                  "path",
                                  "reason"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "skippedDocumentSlugs": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "receipt": {
                              "type": "object",
                              "properties": {
                                "fidelityDigest": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "entries": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "sourceKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "path": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "entryKind": {
                                        "type": "string",
                                        "enum": [
                                          "markdown",
                                          "attachment"
                                        ]
                                      },
                                      "contentHash": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "byteLength": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "mimeType": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactId": {
                                        "type": "string"
                                      },
                                      "artifactVersionId": {
                                        "type": "string"
                                      },
                                      "folderId": {
                                        "type": "string"
                                      },
                                      "result": {
                                        "type": "string",
                                        "enum": [
                                          "created",
                                          "unchanged",
                                          "updated",
                                          "moved",
                                          "deleted",
                                          "conflict",
                                          "skipped"
                                        ]
                                      },
                                      "previousPath": {
                                        "type": "string"
                                      },
                                      "message": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "sourceKey",
                                      "path",
                                      "entryKind",
                                      "contentHash",
                                      "byteLength",
                                      "mimeType",
                                      "result"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "fidelityDigest",
                                "entries"
                              ],
                              "additionalProperties": false
                            },
                            "indexing": {
                              "type": "object",
                              "properties": {
                                "attempted": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "succeeded": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "failed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "succeededArtifactVersionIds": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "failedArtifactVersionIds": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "attempted",
                                "succeeded",
                                "failed",
                                "succeededArtifactVersionIds",
                                "failedArtifactVersionIds"
                              ],
                              "additionalProperties": false
                            },
                            "cancelledAfterApply": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "flavor",
                            "corpusSlug",
                            "knowledgeGraphId",
                            "documentsImported",
                            "pagesTyped",
                            "pagesUntyped",
                            "unclassified",
                            "foldersImported",
                            "linksResolved",
                            "linksUnresolved",
                            "nodeCount",
                            "edgeCount",
                            "nonMarkdownSkipped",
                            "attachmentsImported",
                            "unsupportedPaths",
                            "filesSkipped",
                            "skippedDocumentSlugs"
                          ],
                          "additionalProperties": false
                        },
                        "knowledgeGraphId": {
                          "type": "string"
                        },
                        "enrichmentRunId": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        },
                        "phase": {
                          "type": "string"
                        },
                        "attempt": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "cancelRequested": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        }
                      },
                      "required": [
                        "jobId",
                        "status",
                        "flavor",
                        "corpusSlug",
                        "proposal",
                        "phase",
                        "attempt",
                        "cancelRequested",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import-markdown": {
      "get": {
        "operationId": "KnowledgeBundle_importMarkdownJobs",
        "tags": [
          "KnowledgeBundle"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "imports": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "jobId": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "proposed",
                                  "scheduled",
                                  "running",
                                  "succeeded",
                                  "partial",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "flavor": {
                                "type": "string",
                                "enum": [
                                  "gbrain",
                                  "obsidian",
                                  "karpathy-generic",
                                  "generic"
                                ]
                              },
                              "corpusSlug": {
                                "type": "string"
                              },
                              "proposal": {
                                "type": "object",
                                "properties": {
                                  "flavor": {
                                    "type": "string",
                                    "enum": [
                                      "gbrain",
                                      "obsidian",
                                      "karpathy-generic",
                                      "generic"
                                    ]
                                  },
                                  "corpusSlug": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "corpusName": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "agentFilePresent": {
                                    "type": "boolean"
                                  },
                                  "typeMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "folder": {
                                          "type": "string"
                                        },
                                        "proposedKind": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "fileCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "typedFileCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "observedTypes": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "count": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "count"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "sampleSlugs": {
                                          "maxItems": 8,
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "folder",
                                        "proposedKind",
                                        "fileCount",
                                        "typedFileCount",
                                        "observedTypes",
                                        "sampleSlugs"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "edgeFields": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "field": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sampleCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "field",
                                        "sampleCount"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "preview": {
                                    "type": "object",
                                    "properties": {
                                      "documents": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "pagesTyped": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "pagesUntyped": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "unclassified": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "reason": {
                                              "type": "string",
                                              "enum": [
                                                "no_type_or_folder",
                                                "unknown_type",
                                                "malformed_frontmatter"
                                              ]
                                            },
                                            "declaredType": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "reason"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "linksResolved": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "linksUnresolved": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "foldersDetected": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "nonMarkdownSkipped": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "attachmentsImported": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "unsupportedPaths": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "filesSkipped": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "skippedFiles": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "path": {
                                              "type": "string"
                                            },
                                            "reason": {
                                              "type": "string",
                                              "enum": [
                                                "directory",
                                                "too_large",
                                                "count_limit",
                                                "total_limit",
                                                "unsafe_path"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "path",
                                            "reason"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "documents",
                                      "pagesTyped",
                                      "pagesUntyped",
                                      "unclassified",
                                      "linksResolved",
                                      "linksUnresolved",
                                      "foldersDetected",
                                      "nonMarkdownSkipped",
                                      "attachmentsImported",
                                      "unsupportedPaths",
                                      "filesSkipped",
                                      "skippedFiles"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "flavor",
                                  "corpusSlug",
                                  "corpusName",
                                  "agentFilePresent",
                                  "typeMappings",
                                  "edgeFields",
                                  "preview"
                                ],
                                "additionalProperties": false
                              },
                              "report": {
                                "type": "object",
                                "properties": {
                                  "flavor": {
                                    "type": "string",
                                    "enum": [
                                      "gbrain",
                                      "obsidian",
                                      "karpathy-generic",
                                      "generic"
                                    ]
                                  },
                                  "corpusSlug": {
                                    "type": "string"
                                  },
                                  "knowledgeGraphId": {
                                    "type": "string"
                                  },
                                  "sourceCorpusId": {
                                    "type": "string"
                                  },
                                  "documentsImported": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "pagesTyped": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "pagesUntyped": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "unclassified": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "path": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "reason": {
                                          "type": "string",
                                          "enum": [
                                            "no_type_or_folder",
                                            "unknown_type",
                                            "malformed_frontmatter"
                                          ]
                                        },
                                        "declaredType": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "path",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "foldersImported": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "linksResolved": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "linksUnresolved": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "nodeCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "edgeCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "nonMarkdownSkipped": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "attachmentsImported": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "unsupportedPaths": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "filesSkipped": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "skippedFiles": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "path": {
                                          "type": "string"
                                        },
                                        "reason": {
                                          "type": "string",
                                          "enum": [
                                            "directory",
                                            "too_large",
                                            "count_limit",
                                            "total_limit",
                                            "unsafe_path"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "path",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "skippedDocumentSlugs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "receipt": {
                                    "type": "object",
                                    "properties": {
                                      "fidelityDigest": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "entries": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "sourceKey": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "path": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "entryKind": {
                                              "type": "string",
                                              "enum": [
                                                "markdown",
                                                "attachment"
                                              ]
                                            },
                                            "contentHash": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "byteLength": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "mimeType": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactId": {
                                              "type": "string"
                                            },
                                            "artifactVersionId": {
                                              "type": "string"
                                            },
                                            "folderId": {
                                              "type": "string"
                                            },
                                            "result": {
                                              "type": "string",
                                              "enum": [
                                                "created",
                                                "unchanged",
                                                "updated",
                                                "moved",
                                                "deleted",
                                                "conflict",
                                                "skipped"
                                              ]
                                            },
                                            "previousPath": {
                                              "type": "string"
                                            },
                                            "message": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "sourceKey",
                                            "path",
                                            "entryKind",
                                            "contentHash",
                                            "byteLength",
                                            "mimeType",
                                            "result"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "fidelityDigest",
                                      "entries"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "indexing": {
                                    "type": "object",
                                    "properties": {
                                      "attempted": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "succeeded": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "failed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "succeededArtifactVersionIds": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "failedArtifactVersionIds": {
                                        "default": [],
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "attempted",
                                      "succeeded",
                                      "failed",
                                      "succeededArtifactVersionIds",
                                      "failedArtifactVersionIds"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "cancelledAfterApply": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "flavor",
                                  "corpusSlug",
                                  "knowledgeGraphId",
                                  "documentsImported",
                                  "pagesTyped",
                                  "pagesUntyped",
                                  "unclassified",
                                  "foldersImported",
                                  "linksResolved",
                                  "linksUnresolved",
                                  "nodeCount",
                                  "edgeCount",
                                  "nonMarkdownSkipped",
                                  "attachmentsImported",
                                  "unsupportedPaths",
                                  "filesSkipped",
                                  "skippedDocumentSlugs"
                                ],
                                "additionalProperties": false
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "enrichmentRunId": {
                                "type": "string"
                              },
                              "error": {
                                "type": "string"
                              },
                              "phase": {
                                "type": "string"
                              },
                              "attempt": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "cancelRequested": {
                                "type": "boolean"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "jobId",
                              "status",
                              "flavor",
                              "corpusSlug",
                              "proposal",
                              "phase",
                              "attempt",
                              "cancelRequested",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "imports"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import-markdown/{jobId}/cancel": {
      "post": {
        "operationId": "KnowledgeBundle_importMarkdownCancel",
        "tags": [
          "KnowledgeBundle"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "importMarkdown": {
                          "type": "object",
                          "properties": {
                            "jobId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "scheduled",
                                "running",
                                "succeeded",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            }
                          },
                          "required": [
                            "jobId",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "importMarkdown"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-bundles/import-markdown/{jobId}/retry": {
      "post": {
        "operationId": "KnowledgeBundle_importMarkdownRetry",
        "tags": [
          "KnowledgeBundle"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "importMarkdown": {
                          "type": "object",
                          "properties": {
                            "jobId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "proposed",
                                "scheduled",
                                "running",
                                "succeeded",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            }
                          },
                          "required": [
                            "jobId",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "importMarkdown"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-graphs": {
      "get": {
        "operationId": "Brain_list",
        "tags": [
          "Brain"
        ],
        "summary": "Page through the tenant's Brains.",
        "description": "`key` bypasses paging for a direct create-or-get lookup. Otherwise cursor-paginated (`limit`/`cursor`). Requires the organization API key (`x-api-key`), not a Brain Connection credential — this operation manages the Brain or its Connections themselves, before or beyond any single Connection's scope.",
        "parameters": [
          {
            "name": "schemaSlug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "corpusId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraphs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "schemaSlug": {
                                "type": "string"
                              },
                              "corpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "corpusSlug": {
                                "type": "string"
                              },
                              "origin": {
                                "default": "seeded",
                                "type": "string",
                                "enum": [
                                  "seeded",
                                  "empty",
                                  "empty_with_schema"
                                ]
                              },
                              "sourceCorpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceCorpusSlug": {
                                "type": "string"
                              },
                              "parentKnowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "parentKnowledgeGraphName": {
                                "type": "string"
                              },
                              "directChildCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "brainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "key": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "name": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "subject": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "externalId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      },
                                      "label": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 512
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "label"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "purpose": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "parentBrainId": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "generation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 512
                                  },
                                  "lifecycle": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "held",
                                      "archived",
                                      "deleting",
                                      "deleted"
                                    ]
                                  }
                                },
                                "required": [
                                  "brainId",
                                  "key",
                                  "name",
                                  "subject",
                                  "purpose",
                                  "generation",
                                  "lifecycle"
                                ],
                                "additionalProperties": false
                              },
                              "description": {
                                "type": "string"
                              },
                              "lifecycleState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "inducing",
                                  "ready",
                                  "stale",
                                  "errored"
                                ]
                              },
                              "policy": {
                                "type": "object",
                                "properties": {
                                  "refresh": {
                                    "default": "manual",
                                    "type": "string",
                                    "enum": [
                                      "manual",
                                      "on_corpus_change",
                                      "scheduled"
                                    ]
                                  },
                                  "structuring": {
                                    "type": "string",
                                    "enum": [
                                      "manual",
                                      "on_source_change"
                                    ]
                                  },
                                  "refreshCron": {
                                    "type": "string"
                                  },
                                  "inductionBudgetCents": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "refresh"
                                ],
                                "additionalProperties": false
                              },
                              "writePolicy": {
                                "type": "string",
                                "enum": [
                                  "direct",
                                  "propose"
                                ]
                              },
                              "availabilityState": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "held",
                                  "deleted"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "latestVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "versionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "nodeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "edgeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingChangeSetCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "lastActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "connectionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "activeConnectionCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "connectionHealth": {
                                "type": "string",
                                "enum": [
                                  "never_connected",
                                  "healthy",
                                  "degraded"
                                ]
                              },
                              "lastConnectionActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "schemaSlug",
                              "corpusId",
                              "origin",
                              "name",
                              "identity",
                              "lifecycleState",
                              "policy",
                              "writePolicy",
                              "availabilityState",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "knowledgeGraphs",
                        "hasMore"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "knowledgeGraphs": [
                      {
                        "id": "brain_01J7X1A2BF",
                        "name": "Bob Smith at Project Y",
                        "schemaSlug": "company-os",
                        "generation": "gen_01J8Z3K7QW"
                      }
                    ],
                    "hasMore": false
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Brain_create",
        "tags": [
          "Brain"
        ],
        "summary": "Create a Brain, or return the existing one for a known key.",
        "description": "The console create. Create-or-get: `201` for a newly provisioned Brain, `200` when `key` already names one — retry-safe by construction, no separate idempotency key needed. `declaredSchema` inline-commits a NEW schema before creating the Brain over it (mutually exclusive with `schemaSlug`), and `corpusId` creates the Brain over a corpus you already hold. Integrations use `PUT /v1/brains/{handle}` instead. Requires the organization API key (`x-api-key`), not a Brain Connection credential — this operation manages the Brain or its Connections themselves, before or beyond any single Connection's scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "schemaSlug": {
                    "type": "string",
                    "minLength": 1
                  },
                  "declaredSchema": {
                    "type": "object",
                    "properties": {
                      "slug": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": {
                        "type": "string"
                      },
                      "nodes": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "minLength": 1
                            },
                            "folderPrefix": {
                              "type": "string",
                              "minLength": 1
                            },
                            "folderPrefixes": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "frontmatterType": {
                              "type": "string",
                              "minLength": 1
                            },
                            "classifyByKindName": {
                              "type": "boolean"
                            },
                            "identityField": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "string",
                                      "number",
                                      "boolean",
                                      "enum",
                                      "string_list"
                                    ]
                                  },
                                  "enumValues": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "description": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "type"
                                ]
                              }
                            },
                            "anchor": {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "viaEdge": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "historicalWhen": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "field",
                                "viaEdge"
                              ]
                            }
                          },
                          "required": [
                            "kind"
                          ]
                        }
                      },
                      "edges": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "signal": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "frontmatter-field"
                                    },
                                    "field": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "source",
                                    "field"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "wikilink-mention"
                                    }
                                  },
                                  "required": [
                                    "source"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "regex"
                                    },
                                    "pattern": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "source",
                                    "pattern"
                                  ]
                                }
                              ]
                            },
                            "fromKinds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "toKinds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "description": {
                              "type": "string"
                            },
                            "requireResolvableTarget": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "name",
                            "signal"
                          ]
                        }
                      }
                    },
                    "required": [
                      "slug",
                      "name",
                      "description",
                      "nodes",
                      "edges"
                    ]
                  },
                  "corpusId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "refresh": {
                        "default": "manual",
                        "type": "string",
                        "enum": [
                          "manual",
                          "on_corpus_change",
                          "scheduled"
                        ]
                      },
                      "structuring": {
                        "type": "string",
                        "enum": [
                          "manual",
                          "on_source_change"
                        ]
                      },
                      "refreshCron": {
                        "type": "string"
                      },
                      "inductionBudgetCents": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  },
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "subject": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "externalId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "kind",
                      "label"
                    ]
                  },
                  "purpose": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Bob Smith at Project Y",
                "key": "project-y",
                "subject": {
                  "kind": "external_reference",
                  "externalId": "project-y",
                  "label": "Bob Smith at Project Y"
                },
                "purpose": "Track outreach to Project Y through the Nicia sales motion.",
                "declaredSchema": {
                  "slug": "company-os",
                  "name": "Company OS",
                  "description": "People, companies, ICPs, products, and leads.",
                  "nodes": [
                    {
                      "kind": "person",
                      "frontmatterType": "person",
                      "description": "A person Company OS tracks."
                    },
                    {
                      "kind": "lead",
                      "frontmatterType": "lead",
                      "description": "A sales lead.",
                      "fields": [
                        {
                          "name": "stage",
                          "type": "enum",
                          "enumValues": [
                            "qualifying",
                            "qualified",
                            "meeting_scheduled"
                          ]
                        }
                      ]
                    }
                  ],
                  "edges": [
                    {
                      "name": "works_at",
                      "signal": {
                        "source": "frontmatter-field",
                        "field": "company"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "knowledgeGraph": {
                      "id": "brain_01J7X1A2BF",
                      "name": "Bob Smith at Project Y",
                      "schemaSlug": "company-os",
                      "generation": "gen_01J8Z3K7QW"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "knowledgeGraph": {
                      "id": "brain_01J7X1A2BF",
                      "name": "Bob Smith at Project Y",
                      "schemaSlug": "company-os",
                      "generation": "gen_01J8Z3K7QW"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/clone": {
      "post": {
        "operationId": "Brain_clone",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "empty",
                      "full"
                    ]
                  }
                },
                "required": [
                  "name",
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-graphs/{id}": {
      "get": {
        "operationId": "Brain_get",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "latestVersion": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaVersionFingerprint": {
                              "type": "string"
                            },
                            "artifactVersionIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "inducedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "knowledgeGraphId",
                            "runId",
                            "schemaVersionFingerprint",
                            "artifactVersionIds",
                            "nodeCount",
                            "edgeCount",
                            "inducedAt",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "versionCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "knowledgeGraph",
                        "versionCount"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Brain_update",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "refresh": {
                        "default": "manual",
                        "type": "string",
                        "enum": [
                          "manual",
                          "on_corpus_change",
                          "scheduled"
                        ]
                      },
                      "structuring": {
                        "type": "string",
                        "enum": [
                          "manual",
                          "on_source_change"
                        ]
                      },
                      "refreshCron": {
                        "type": "string"
                      },
                      "inductionBudgetCents": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  },
                  "writePolicy": {
                    "type": "string",
                    "enum": [
                      "direct",
                      "propose"
                    ]
                  },
                  "parentKnowledgeGraphId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Brain_delete",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/corpora": {
      "get": {
        "operationId": "Brain_getCorpora",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "which",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "owned",
                "source"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ownedCorpus": {
                          "type": "object",
                          "properties": {
                            "corpus": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "slug",
                                "name",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "artifacts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "nameSlug": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "producedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "name",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "memberPaths": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "artifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "folderPath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "artifactId",
                                  "folderPath"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "folderIncludes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "folderId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  },
                                  "position": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "folderId",
                                  "name",
                                  "slug",
                                  "position"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "latestVersion": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "memberCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "memberCount",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "sources": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "provider": {
                                    "type": "string",
                                    "enum": [
                                      "google_docs",
                                      "notion",
                                      "confluence",
                                      "url"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "paused",
                                      "error",
                                      "pending_auth"
                                    ]
                                  },
                                  "lastSyncAt": {
                                    "type": "string"
                                  },
                                  "lastSyncError": {
                                    "type": "string"
                                  },
                                  "scope": {
                                    "type": "string",
                                    "enum": [
                                      "org",
                                      "user"
                                    ]
                                  },
                                  "syncIntervalMs": {
                                    "type": "number"
                                  },
                                  "accountEmail": {
                                    "type": "string"
                                  },
                                  "artifactCount": {
                                    "type": "number"
                                  },
                                  "canPromote": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "provider",
                                  "name",
                                  "status",
                                  "scope"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "corpus",
                            "artifacts",
                            "memberPaths",
                            "folderIncludes",
                            "versionCount",
                            "sources"
                          ],
                          "additionalProperties": false
                        },
                        "sourceCorpus": {
                          "type": "object",
                          "properties": {
                            "corpus": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "slug",
                                "name",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "artifacts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "nameSlug": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "producedByRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "name",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "memberPaths": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "artifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "folderPath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "artifactId",
                                  "folderPath"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "folderIncludes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "folderId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  },
                                  "position": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "folderId",
                                  "name",
                                  "slug",
                                  "position"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "latestVersion": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "memberCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "memberCount",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            },
                            "sources": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "provider": {
                                    "type": "string",
                                    "enum": [
                                      "google_docs",
                                      "notion",
                                      "confluence",
                                      "url"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "paused",
                                      "error",
                                      "pending_auth"
                                    ]
                                  },
                                  "lastSyncAt": {
                                    "type": "string"
                                  },
                                  "lastSyncError": {
                                    "type": "string"
                                  },
                                  "scope": {
                                    "type": "string",
                                    "enum": [
                                      "org",
                                      "user"
                                    ]
                                  },
                                  "syncIntervalMs": {
                                    "type": "number"
                                  },
                                  "accountEmail": {
                                    "type": "string"
                                  },
                                  "artifactCount": {
                                    "type": "number"
                                  },
                                  "canPromote": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "provider",
                                  "name",
                                  "status",
                                  "scope"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "corpus",
                            "artifacts",
                            "memberPaths",
                            "folderIncludes",
                            "versionCount",
                            "sources"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/entities": {
      "get": {
        "operationId": "Brain_listEntities",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "atRecorded",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "entities": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string"
                              },
                              "artifactVersionId": {
                                "type": "string"
                              },
                              "sourcePath": {
                                "type": "string"
                              },
                              "body": {
                                "type": "string"
                              },
                              "indexed": {
                                "type": "boolean"
                              },
                              "snippet": {
                                "type": "string"
                              },
                              "relationships": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "edge": {
                                      "type": "string"
                                    },
                                    "toId": {
                                      "type": "string"
                                    },
                                    "toKind": {
                                      "type": "string"
                                    },
                                    "toTitle": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "edge",
                                    "toId",
                                    "toKind",
                                    "toTitle"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "staleness": {
                                "type": "object",
                                "properties": {
                                  "answerSlug": {
                                    "type": "string"
                                  },
                                  "answerChangedAt": {
                                    "type": "string"
                                  },
                                  "movedInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "slug": {
                                          "type": "string"
                                        },
                                        "changedAt": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "slug",
                                        "changedAt"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "newEvidence": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "slug": {
                                          "type": "string"
                                        },
                                        "changedAt": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "slug",
                                        "changedAt"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "undatable": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "answerSlug",
                                  "movedInputs",
                                  "newEvidence",
                                  "undatable"
                                ],
                                "additionalProperties": false
                              },
                              "claimSupport": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "verified",
                                      "support_at_risk",
                                      "contradicted",
                                      "unverified"
                                    ]
                                  },
                                  "lifecycle": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "superseded",
                                      "unknown"
                                    ]
                                  },
                                  "admission": {
                                    "type": "object",
                                    "properties": {
                                      "acceptedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "user",
                                          "agent",
                                          "system"
                                        ]
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "changeSetId": {
                                        "type": "string"
                                      },
                                      "changeSetItemId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "acceptedAt",
                                      "actorKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "source": {
                                    "type": "object",
                                    "properties": {
                                      "slug": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "artifactId": {
                                        "type": "string"
                                      },
                                      "acceptedArtifactVersionId": {
                                        "type": "string"
                                      },
                                      "currentArtifactVersionId": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      },
                                      "fragmentHash": {
                                        "type": "string"
                                      },
                                      "integrity": {
                                        "type": "string",
                                        "enum": [
                                          "verified",
                                          "source_changed"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "slug",
                                      "title",
                                      "artifactId",
                                      "acceptedArtifactVersionId",
                                      "fragmentHash",
                                      "integrity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "contradictions": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "slug": {
                                          "type": "string"
                                        },
                                        "title": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "slug",
                                        "title"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "status",
                                  "lifecycle",
                                  "contradictions"
                                ],
                                "additionalProperties": false
                              },
                              "answerSupport": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "verified",
                                      "support_at_risk",
                                      "contradicted",
                                      "unverified"
                                    ]
                                  },
                                  "verifiedClaims": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "atRiskClaims": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "contradictedClaims": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "unverifiedClaims": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "admission": {
                                    "type": "object",
                                    "properties": {
                                      "acceptedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "user",
                                          "agent",
                                          "system"
                                        ]
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "changeSetId": {
                                        "type": "string"
                                      },
                                      "changeSetItemId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "acceptedAt",
                                      "actorKind"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "evaluation": {
                                    "type": "object",
                                    "properties": {
                                      "state": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "running",
                                          "passed",
                                          "warned",
                                          "failed",
                                          "unavailable",
                                          "stale"
                                        ]
                                      },
                                      "score": {
                                        "type": "number"
                                      },
                                      "evaluatedAt": {
                                        "type": "string"
                                      },
                                      "runId": {
                                        "type": "string"
                                      },
                                      "overridden": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "state",
                                      "overridden"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "observedUse": {
                                    "type": "object",
                                    "properties": {
                                      "receiptCount": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "consumerCount": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "lastUsedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      "incomplete": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "receiptCount",
                                      "consumerCount",
                                      "lastUsedAt",
                                      "incomplete"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "status",
                                  "verifiedClaims",
                                  "atRiskClaims",
                                  "contradictedClaims",
                                  "unverifiedClaims"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "slug",
                              "title",
                              "relationships"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "artifactId": {
                                "type": "string"
                              },
                              "artifactVersionId": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sourcePath": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "artifactId",
                              "artifactVersionId",
                              "title",
                              "mimeType",
                              "sourcePath"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nodeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "edgeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "schemaSlug": {
                          "type": "string"
                        },
                        "projectSlug": {
                          "type": "string"
                        },
                        "schemaMissing": {
                          "type": "boolean"
                        },
                        "availableKinds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "fields": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "string",
                                        "number",
                                        "boolean",
                                        "enum",
                                        "string_list"
                                      ]
                                    },
                                    "enumValues": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "description": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "type"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "name",
                              "label"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "availableEdgeKinds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "name",
                              "label"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "precision": {
                          "type": "string",
                          "enum": [
                            "valid_time"
                          ]
                        },
                        "at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "entities",
                        "attachments",
                        "nodeCount",
                        "edgeCount",
                        "schemaSlug"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-graphs/{id}/search": {
      "get": {
        "operationId": "Brain_search",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fulltext",
                "hybrid"
              ]
            }
          },
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string"
                              },
                              "artifactName": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1
                              },
                              "snippet": {
                                "type": "string"
                              },
                              "rank": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "citeToken": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "artifactId",
                              "artifactName",
                              "slug",
                              "snippet",
                              "rank",
                              "citeToken"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "query",
                        "results"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/think": {
      "get": {
        "operationId": "Brain_think",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "answer": {
                          "type": "string"
                        },
                        "citations": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "gaps": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "citeToken": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string"
                              },
                              "artifactName": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1
                              },
                              "rank": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "basis": {
                                "type": "string",
                                "enum": [
                                  "accepted_claim",
                                  "source_page"
                                ]
                              },
                              "claimSupport": {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "verified",
                                      "support_at_risk",
                                      "contradicted",
                                      "unverified"
                                    ]
                                  },
                                  "lifecycle": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "superseded",
                                      "unknown"
                                    ]
                                  },
                                  "source": {
                                    "type": "object",
                                    "properties": {
                                      "slug": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      },
                                      "integrity": {
                                        "type": "string",
                                        "enum": [
                                          "verified",
                                          "source_changed"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "slug",
                                      "title",
                                      "integrity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "contradictions": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "slug": {
                                          "type": "string"
                                        },
                                        "title": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "slug",
                                        "title"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "status",
                                  "lifecycle",
                                  "contradictions"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "citeToken",
                              "artifactId",
                              "artifactName",
                              "slug",
                              "rank",
                              "basis"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "foundation": {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "enum": [
                                "accepted_claims",
                                "source_pages"
                              ]
                            },
                            "acceptedClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "sourceDocuments": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "conflicts": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "atRiskClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "knowledgeGraphVersionId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "mode",
                            "acceptedClaims",
                            "sourceDocuments",
                            "conflicts",
                            "atRiskClaims"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "query",
                        "answer",
                        "citations",
                        "gaps",
                        "sources",
                        "foundation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/graph-query": {
      "get": {
        "operationId": "Brain_graphQuery",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "edges",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "out",
                "in",
                "both"
              ]
            }
          },
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "root": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string"
                            },
                            "kind": {
                              "type": "string"
                            },
                            "depth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "slug",
                            "kind",
                            "depth"
                          ],
                          "additionalProperties": false
                        },
                        "nodes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "depth": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "slug",
                              "kind",
                              "depth"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "edges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "fromSlug": {
                                "type": "string"
                              },
                              "edgeKind": {
                                "type": "string"
                              },
                              "toSlug": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "fromSlug",
                              "edgeKind",
                              "toSlug"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "nodes",
                        "edges"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/hold": {
      "post": {
        "operationId": "Brain_hold",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/release": {
      "post": {
        "operationId": "Brain_release",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "knowledgeGraph"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/capture": {
      "post": {
        "operationId": "Brain_capture",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "corpusId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "body": {
                    "type": "string"
                  },
                  "relationships": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "edgeKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetSlug": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "edgeKind",
                        "targetSlug"
                      ]
                    }
                  },
                  "properties": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "preservedFrontmatter": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "correctsEventId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "corpusId",
                  "kind",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "entity": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "proposed": {
                                  "type": "boolean",
                                  "const": true
                                },
                                "changeSetId": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "knowledgeGraphId": {
                                  "type": "string"
                                },
                                "correctsEventId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "proposed",
                                "changeSetId",
                                "slug",
                                "knowledgeGraphId"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "proposed": {
                                  "type": "boolean",
                                  "const": false
                                },
                                "artifactId": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "knowledgeGraphId": {
                                  "type": "string"
                                },
                                "nodeCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "edgeCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "correctionEventId": {
                                  "type": "string"
                                },
                                "correctsEventId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "artifactId",
                                "slug",
                                "knowledgeGraphId",
                                "nodeCount",
                                "edgeCount"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "entity"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/rename-page": {
      "post": {
        "operationId": "Brain_renamePage",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "artifactId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "newName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "artifactId",
                  "newName"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "renamed": {
                          "type": "object",
                          "properties": {
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "oldSlug": {
                              "type": "string"
                            },
                            "newSlug": {
                              "type": "string"
                            },
                            "patchedPageCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "knowledgeGraphId",
                            "oldSlug",
                            "newSlug",
                            "patchedPageCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "renamed"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/page-deletion-plan": {
      "get": {
        "operationId": "Brain_pageDeletionPlan",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "artifactId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "plan": {
                          "type": "object",
                          "properties": {
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "artifactId": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "inboundLinks": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "slug",
                                  "title",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "repointCandidates": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "slug",
                                  "title"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "knowledgeGraphId",
                            "artifactId",
                            "slug",
                            "title",
                            "entityKind",
                            "inboundLinks",
                            "repointCandidates"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "plan"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/delete-page": {
      "post": {
        "operationId": "Brain_deletePage",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "artifactId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "inboundLinks": {
                    "default": {
                      "kind": "keep"
                    },
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "keep"
                          }
                        },
                        "required": [
                          "kind"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "remove"
                          }
                        },
                        "required": [
                          "kind"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "repoint"
                          },
                          "toSlug": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "kind",
                          "toSlug"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "artifactId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "object",
                          "properties": {
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "adopted": {
                              "type": "boolean"
                            },
                            "patchedPageCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "knowledgeGraphId",
                            "slug",
                            "title",
                            "changeSetId",
                            "adopted",
                            "patchedPageCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/activity": {
      "get": {
        "operationId": "Brain_activity",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "milestones",
                "writes"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "wired",
                                  "page_created",
                                  "page_edited",
                                  "entity_deleted",
                                  "imported",
                                  "structured",
                                  "revision",
                                  "availability_changed"
                                ]
                              },
                              "at": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "detail": {
                                "type": "string"
                              },
                              "actorKind": {
                                "type": "string",
                                "enum": [
                                  "agent",
                                  "user",
                                  "system"
                                ]
                              },
                              "actorLabel": {
                                "type": "string"
                              },
                              "causingRunId": {
                                "type": "string"
                              },
                              "changeSetId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "at",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "events"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-graphs/{id}/changes": {
      "get": {
        "operationId": "Brain_changes",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "changeType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created",
                "updated",
                "deleted"
              ]
            }
          },
          {
            "name": "actorKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "user",
                "system"
              ]
            }
          },
          {
            "name": "entityKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "knowledgeGraphId": {
                          "type": "string"
                        },
                        "since": {
                          "type": "string"
                        },
                        "until": {
                          "type": "string"
                        },
                        "total": {
                          "type": "number"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "byChangeType": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "number"
                          }
                        },
                        "byActorKind": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "number"
                          }
                        },
                        "byEntityKind": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "number"
                          }
                        },
                        "byDay": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "day": {
                                "type": "string"
                              },
                              "count": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "day",
                              "count"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "distinctActors": {
                          "type": "number"
                        },
                        "distinctPages": {
                          "type": "number"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "eventId": {
                                "type": "string"
                              },
                              "at": {
                                "type": "string"
                              },
                              "changeType": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "updated",
                                  "deleted"
                                ]
                              },
                              "entityKind": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string"
                              },
                              "actorKind": {
                                "type": "string",
                                "enum": [
                                  "agent",
                                  "user",
                                  "system"
                                ]
                              },
                              "actorLabel": {
                                "type": "string"
                              },
                              "causingRunId": {
                                "type": "string"
                              },
                              "changeSetId": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "agentName": {
                                    "type": "string"
                                  },
                                  "agentVersion": {
                                    "type": "string"
                                  },
                                  "model": {
                                    "type": "string"
                                  },
                                  "sources": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "tier": {
                                    "type": "string",
                                    "enum": [
                                      "boundary",
                                      "self_reported",
                                      "instrumented"
                                    ]
                                  }
                                },
                                "required": [
                                  "tier"
                                ],
                                "additionalProperties": false
                              },
                              "correctsEventId": {
                                "type": "string"
                              },
                              "correctsAt": {
                                "type": "string"
                              },
                              "correctedByEventId": {
                                "type": "string"
                              },
                              "correctedByAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "eventId",
                              "at",
                              "changeType",
                              "slug",
                              "artifactId",
                              "actorKind"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "knowledgeGraphId",
                        "total",
                        "truncated",
                        "byChangeType",
                        "byActorKind",
                        "byEntityKind",
                        "byDay",
                        "distinctActors",
                        "distinctPages",
                        "rows"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/changes/{eventId}": {
      "get": {
        "operationId": "Brain_changeDetail",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "change": {
                          "type": "object",
                          "properties": {
                            "eventId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "changeType": {
                              "type": "string",
                              "enum": [
                                "created",
                                "updated",
                                "deleted"
                              ]
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "artifactId": {
                              "type": "string"
                            },
                            "actorKind": {
                              "type": "string",
                              "enum": [
                                "agent",
                                "user",
                                "system"
                              ]
                            },
                            "actorLabel": {
                              "type": "string"
                            },
                            "causingRunId": {
                              "type": "string"
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string"
                                },
                                "agentVersion": {
                                  "type": "string"
                                },
                                "model": {
                                  "type": "string"
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "tier": {
                                  "type": "string",
                                  "enum": [
                                    "boundary",
                                    "self_reported",
                                    "instrumented"
                                  ]
                                }
                              },
                              "required": [
                                "tier"
                              ],
                              "additionalProperties": false
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "correctsAt": {
                              "type": "string"
                            },
                            "correctedByEventId": {
                              "type": "string"
                            },
                            "correctedByAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "eventId",
                            "at",
                            "changeType",
                            "slug",
                            "artifactId",
                            "actorKind"
                          ],
                          "additionalProperties": false
                        },
                        "corrects": {
                          "type": "object",
                          "properties": {
                            "eventId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "changeType": {
                              "type": "string",
                              "enum": [
                                "created",
                                "updated",
                                "deleted"
                              ]
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "artifactId": {
                              "type": "string"
                            },
                            "actorKind": {
                              "type": "string",
                              "enum": [
                                "agent",
                                "user",
                                "system"
                              ]
                            },
                            "actorLabel": {
                              "type": "string"
                            },
                            "causingRunId": {
                              "type": "string"
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string"
                                },
                                "agentVersion": {
                                  "type": "string"
                                },
                                "model": {
                                  "type": "string"
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "tier": {
                                  "type": "string",
                                  "enum": [
                                    "boundary",
                                    "self_reported",
                                    "instrumented"
                                  ]
                                }
                              },
                              "required": [
                                "tier"
                              ],
                              "additionalProperties": false
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "correctsAt": {
                              "type": "string"
                            },
                            "correctedByEventId": {
                              "type": "string"
                            },
                            "correctedByAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "eventId",
                            "at",
                            "changeType",
                            "slug",
                            "artifactId",
                            "actorKind"
                          ],
                          "additionalProperties": false
                        },
                        "correctedBy": {
                          "type": "object",
                          "properties": {
                            "eventId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "changeType": {
                              "type": "string",
                              "enum": [
                                "created",
                                "updated",
                                "deleted"
                              ]
                            },
                            "entityKind": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "artifactId": {
                              "type": "string"
                            },
                            "actorKind": {
                              "type": "string",
                              "enum": [
                                "agent",
                                "user",
                                "system"
                              ]
                            },
                            "actorLabel": {
                              "type": "string"
                            },
                            "causingRunId": {
                              "type": "string"
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "agentName": {
                                  "type": "string"
                                },
                                "agentVersion": {
                                  "type": "string"
                                },
                                "model": {
                                  "type": "string"
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "tier": {
                                  "type": "string",
                                  "enum": [
                                    "boundary",
                                    "self_reported",
                                    "instrumented"
                                  ]
                                }
                              },
                              "required": [
                                "tier"
                              ],
                              "additionalProperties": false
                            },
                            "correctsEventId": {
                              "type": "string"
                            },
                            "correctsAt": {
                              "type": "string"
                            },
                            "correctedByEventId": {
                              "type": "string"
                            },
                            "correctedByAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "eventId",
                            "at",
                            "changeType",
                            "slug",
                            "artifactId",
                            "actorKind"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "change"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/events/{eventId}/affected": {
      "get": {
        "operationId": "Brain_affected",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "observedConsumers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "consumerKind": {
                                "type": "string",
                                "enum": [
                                  "run",
                                  "external"
                                ]
                              },
                              "runId": {
                                "type": "string"
                              },
                              "externalRunId": {
                                "type": "string"
                              },
                              "principal": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "id": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "id"
                                ],
                                "additionalProperties": false
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "firstReadAt": {
                                "type": "string"
                              },
                              "granularity": {
                                "type": "string",
                                "enum": [
                                  "version",
                                  "node"
                                ]
                              },
                              "propagation": {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "not_notified",
                                      "notified",
                                      "notification_failed",
                                      "observed_corrected_knowledge",
                                      "reexecution_started",
                                      "reexecution_completed",
                                      "reexecution_failed"
                                    ]
                                  },
                                  "updatedAt": {
                                    "type": "string"
                                  },
                                  "evidenceAt": {
                                    "type": "string"
                                  },
                                  "runId": {
                                    "type": "string"
                                  },
                                  "webhookDeliveryId": {
                                    "type": "string"
                                  },
                                  "lastError": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "state",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "consumerKind",
                              "firstReadAt",
                              "granularity",
                              "propagation"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "candidateRuns": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "firstReadAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "runId"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "observedConsumers",
                        "candidateRuns",
                        "truncated"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/rewire": {
      "post": {
        "operationId": "Brain_rewire",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "nodeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "edgeCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "nodeCount",
                        "edgeCount"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/garden": {
      "post": {
        "operationId": "Brain_garden",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "garden": {
                          "type": "object",
                          "properties": {
                            "pageCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "brokenLinks": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "fromSlug": {
                                    "type": "string"
                                  },
                                  "fromTitle": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "fromSlug",
                                  "fromTitle",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "orphans": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "slug": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "slug",
                                  "title"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "duplicates": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "slugs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "key",
                                  "slugs"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "pageCount",
                            "brokenLinks",
                            "orphans",
                            "duplicates"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "garden"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/structure/candidates": {
      "get": {
        "operationId": "Brain_structureCandidates",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "candidates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "currentKind": {
                                "type": "string"
                              },
                              "duplicateOf": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "slug",
                              "title",
                              "duplicateOf"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "settled": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "by": {
                                "type": "string",
                                "enum": [
                                  "frontmatter_type",
                                  "folder_prefix"
                                ]
                              }
                            },
                            "required": [
                              "slug",
                              "title",
                              "kind",
                              "by"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "blocked": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "slug",
                              "title",
                              "reason"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "candidates",
                        "settled",
                        "blocked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/schema-packs": {
      "post": {
        "operationId": "Brain_installSchemaPack",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packId": {
                    "type": "string",
                    "const": "standing-answers"
                  }
                },
                "required": [
                  "packId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schemaPack": {
                          "type": "object",
                          "properties": {
                            "packId": {
                              "type": "string"
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "alreadyInstalled": {
                              "type": "boolean"
                            },
                            "kinds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "packId",
                            "schemaSlug",
                            "alreadyInstalled",
                            "kinds",
                            "edges"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "schemaPack"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/maintained-knowledge": {
      "get": {
        "operationId": "Brain_maintainedKnowledge",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "maintainedKnowledge": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "enum": [
                                "not_configured",
                                "incomplete",
                                "ready"
                              ]
                            },
                            "packInstalled": {
                              "type": "boolean"
                            },
                            "regressionGoalReady": {
                              "type": "boolean"
                            },
                            "agents": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "role": {
                                    "type": "string",
                                    "enum": [
                                      "compose_answer",
                                      "rebuild_answer"
                                    ]
                                  },
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "agentName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "role",
                                  "agentId",
                                  "agentName"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "rebuildAutomation": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "enabled": {
                                  "type": "boolean"
                                },
                                "testOutcome": {
                                  "type": "string",
                                  "enum": [
                                    "passed",
                                    "failed"
                                  ]
                                },
                                "testRunId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "enabled"
                              ],
                              "additionalProperties": false
                            },
                            "claimsBuild": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "scheduled",
                                    "extracting",
                                    "reconciling",
                                    "planning",
                                    "awaiting_review",
                                    "completed",
                                    "partial",
                                    "failed",
                                    "cancelled"
                                  ]
                                },
                                "phase": {
                                  "type": "string"
                                },
                                "totalPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "completedPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "failedPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "candidateClaims": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetId": {
                                  "type": "string"
                                },
                                "error": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "status",
                                "phase",
                                "totalPages",
                                "completedPages",
                                "failedPages",
                                "candidateClaims"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "state",
                            "packInstalled",
                            "regressionGoalReady",
                            "agents"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "maintainedKnowledge"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/maintained-knowledge/setup": {
      "post": {
        "operationId": "Brain_setupMaintainedKnowledge",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "maintainedKnowledge": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "enum": [
                                "not_configured",
                                "incomplete",
                                "ready"
                              ]
                            },
                            "packInstalled": {
                              "type": "boolean"
                            },
                            "regressionGoalReady": {
                              "type": "boolean"
                            },
                            "agents": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "role": {
                                    "type": "string",
                                    "enum": [
                                      "compose_answer",
                                      "rebuild_answer"
                                    ]
                                  },
                                  "agentId": {
                                    "type": "string"
                                  },
                                  "agentName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "role",
                                  "agentId",
                                  "agentName"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "rebuildAutomation": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "enabled": {
                                  "type": "boolean"
                                },
                                "testOutcome": {
                                  "type": "string",
                                  "enum": [
                                    "passed",
                                    "failed"
                                  ]
                                },
                                "testRunId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "enabled"
                              ],
                              "additionalProperties": false
                            },
                            "claimsBuild": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "scheduled",
                                    "extracting",
                                    "reconciling",
                                    "planning",
                                    "awaiting_review",
                                    "completed",
                                    "partial",
                                    "failed",
                                    "cancelled"
                                  ]
                                },
                                "phase": {
                                  "type": "string"
                                },
                                "totalPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "completedPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "failedPages": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "candidateClaims": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetId": {
                                  "type": "string"
                                },
                                "error": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "status",
                                "phase",
                                "totalPages",
                                "completedPages",
                                "failedPages",
                                "candidateClaims"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "state",
                            "packInstalled",
                            "regressionGoalReady",
                            "agents"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "maintainedKnowledge"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/claims-builds": {
      "post": {
        "operationId": "Brain_startClaimsBuild",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "reconciling",
                                "planning",
                                "awaiting_review",
                                "completed",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "phase": {
                              "type": "string"
                            },
                            "modelId": {
                              "type": "string"
                            },
                            "attempt": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "totalPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "completedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "failedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "candidateClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "conflictCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string"
                                  },
                                  "artifactId": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "extracting",
                                      "succeeded",
                                      "failed"
                                    ]
                                  },
                                  "claimCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "providerId": {
                                    "type": "string"
                                  },
                                  "fallbackFromModelId": {
                                    "type": "string"
                                  },
                                  "escalationReason": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "rejected_candidates"
                                    ]
                                  },
                                  "error": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "artifactId",
                                  "title",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "planDigest": {
                              "type": "string"
                            },
                            "semanticPlan": {},
                            "error": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "status",
                            "phase",
                            "modelId",
                            "attempt",
                            "totalPages",
                            "completedPages",
                            "failedPages",
                            "candidateClaims",
                            "conflictCount",
                            "pages",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/claims-builds/{jobId}": {
      "get": {
        "operationId": "Brain_claimsBuildStatus",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "reconciling",
                                "planning",
                                "awaiting_review",
                                "completed",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "phase": {
                              "type": "string"
                            },
                            "modelId": {
                              "type": "string"
                            },
                            "attempt": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "totalPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "completedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "failedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "candidateClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "conflictCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string"
                                  },
                                  "artifactId": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "extracting",
                                      "succeeded",
                                      "failed"
                                    ]
                                  },
                                  "claimCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "providerId": {
                                    "type": "string"
                                  },
                                  "fallbackFromModelId": {
                                    "type": "string"
                                  },
                                  "escalationReason": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "rejected_candidates"
                                    ]
                                  },
                                  "error": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "artifactId",
                                  "title",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "planDigest": {
                              "type": "string"
                            },
                            "semanticPlan": {},
                            "error": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "status",
                            "phase",
                            "modelId",
                            "attempt",
                            "totalPages",
                            "completedPages",
                            "failedPages",
                            "candidateClaims",
                            "conflictCount",
                            "pages",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/claims-builds/{jobId}/cancel": {
      "post": {
        "operationId": "Brain_cancelClaimsBuild",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "reconciling",
                                "planning",
                                "awaiting_review",
                                "completed",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "phase": {
                              "type": "string"
                            },
                            "modelId": {
                              "type": "string"
                            },
                            "attempt": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "totalPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "completedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "failedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "candidateClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "conflictCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string"
                                  },
                                  "artifactId": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "extracting",
                                      "succeeded",
                                      "failed"
                                    ]
                                  },
                                  "claimCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "providerId": {
                                    "type": "string"
                                  },
                                  "fallbackFromModelId": {
                                    "type": "string"
                                  },
                                  "escalationReason": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "rejected_candidates"
                                    ]
                                  },
                                  "error": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "artifactId",
                                  "title",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "planDigest": {
                              "type": "string"
                            },
                            "semanticPlan": {},
                            "error": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "status",
                            "phase",
                            "modelId",
                            "attempt",
                            "totalPages",
                            "completedPages",
                            "failedPages",
                            "candidateClaims",
                            "conflictCount",
                            "pages",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/claims-builds/{jobId}/retry": {
      "post": {
        "operationId": "Brain_retryClaimsBuild",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "scheduled",
                                "extracting",
                                "reconciling",
                                "planning",
                                "awaiting_review",
                                "completed",
                                "partial",
                                "failed",
                                "cancelled"
                              ]
                            },
                            "phase": {
                              "type": "string"
                            },
                            "modelId": {
                              "type": "string"
                            },
                            "attempt": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "totalPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "completedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "failedPages": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "candidateClaims": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "conflictCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "evidenceId": {
                                    "type": "string"
                                  },
                                  "artifactId": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "extracting",
                                      "succeeded",
                                      "failed"
                                    ]
                                  },
                                  "claimCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "providerId": {
                                    "type": "string"
                                  },
                                  "fallbackFromModelId": {
                                    "type": "string"
                                  },
                                  "escalationReason": {
                                    "type": "string",
                                    "enum": [
                                      "provider_error",
                                      "rejected_candidates"
                                    ]
                                  },
                                  "error": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "evidenceId",
                                  "artifactId",
                                  "title",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "changeSetId": {
                              "type": "string"
                            },
                            "planDigest": {
                              "type": "string"
                            },
                            "semanticPlan": {},
                            "error": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "status",
                            "phase",
                            "modelId",
                            "attempt",
                            "totalPages",
                            "completedPages",
                            "failedPages",
                            "candidateClaims",
                            "conflictCount",
                            "pages",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/agents": {
      "get": {
        "operationId": "Brain_agents",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "agentId": {
                                "type": "string"
                              },
                              "agentName": {
                                "type": "string"
                              },
                              "queryMode": {
                                "type": "string",
                                "enum": [
                                  "read_only",
                                  "read_write"
                                ]
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "maintainer",
                                  "brain_agent"
                                ]
                              },
                              "conversationId": {
                                "type": "string"
                              },
                              "maintenanceInstructions": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "agentId",
                              "agentName",
                              "queryMode",
                              "role"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "agents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/agent": {
      "post": {
        "operationId": "Brain_ensureAgent",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "conversation": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "titleAutoGenerated": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "archived",
                                "deleted"
                              ]
                            },
                            "lastRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lastActiveAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "participantUserIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "title",
                            "titleAutoGenerated",
                            "state",
                            "createdByUserId",
                            "participantUserIds",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent",
                        "conversation"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/changesets": {
      "get": {
        "operationId": "Brain_listChangeSets",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changesets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "changeset": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "proposed",
                                      "adopting",
                                      "adopted",
                                      "reverting",
                                      "reverted",
                                      "rejected",
                                      "dismissed"
                                    ]
                                  },
                                  "reasoning": {
                                    "type": "string"
                                  },
                                  "feedback": {
                                    "type": "string"
                                  },
                                  "predictedScore": {
                                    "type": "number"
                                  },
                                  "actualScore": {
                                    "type": "number"
                                  },
                                  "proposalSource": {
                                    "type": "string",
                                    "enum": [
                                      "reflection",
                                      "nightly_improvement",
                                      "knowledge_capture",
                                      "gardening",
                                      "automation",
                                      "semantic_kernel",
                                      "external_agent"
                                    ]
                                  },
                                  "producingRunId": {
                                    "type": "string"
                                  },
                                  "evidenceRunIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "agentName": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "agentVersion": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "model": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "externalRunId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "sources": {
                                        "maxItems": 50,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 500
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "brainMutationBatchId": {
                                    "type": "string"
                                  },
                                  "brainMutationPolicyVersionId": {
                                    "type": "string"
                                  },
                                  "brainMutationReasons": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "provenanceTier": {
                                    "type": "string",
                                    "enum": [
                                      "boundary",
                                      "self_reported",
                                      "instrumented"
                                    ]
                                  },
                                  "evaluationState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "passed",
                                      "warned",
                                      "failed",
                                      "unavailable",
                                      "stale"
                                    ]
                                  },
                                  "evaluationScore": {
                                    "type": "number"
                                  },
                                  "evaluationRunId": {
                                    "type": "string"
                                  },
                                  "evaluationFingerprint": {
                                    "type": "string"
                                  },
                                  "evaluatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "evaluationOverride": {
                                    "type": "object",
                                    "properties": {
                                      "reason": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string"
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "evaluationState": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "running",
                                          "passed",
                                          "warned",
                                          "failed",
                                          "unavailable",
                                          "stale"
                                        ]
                                      },
                                      "overriddenAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      }
                                    },
                                    "required": [
                                      "reason",
                                      "actorKind",
                                      "evaluationState",
                                      "overriddenAt"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "tenantId",
                                  "status",
                                  "provenanceTier",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "items": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "itemType": {
                                      "type": "string",
                                      "enum": [
                                        "system_prompt",
                                        "artifact",
                                        "skill_version",
                                        "corpus_membership",
                                        "knowledge_entity",
                                        "knowledge_schema",
                                        "brain_automation"
                                      ]
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "applied",
                                        "reverted",
                                        "failed",
                                        "rejected"
                                      ]
                                    },
                                    "targetId": {
                                      "type": "string"
                                    },
                                    "beforeHash": {
                                      "type": "string"
                                    },
                                    "afterHash": {
                                      "type": "string"
                                    },
                                    "beforeContent": {
                                      "type": "string"
                                    },
                                    "afterContent": {
                                      "type": "string"
                                    },
                                    "resultingSkillVersionId": {
                                      "type": "string"
                                    },
                                    "resultingArtifactVersionId": {
                                      "type": "string"
                                    },
                                    "resultingAgentPromptVersionId": {
                                      "type": "string"
                                    },
                                    "baseCorpusVersionId": {
                                      "type": "string"
                                    },
                                    "sourceRunArtifactId": {
                                      "type": "string"
                                    },
                                    "sourceArtifactId": {
                                      "type": "string"
                                    },
                                    "resultingArtifactId": {
                                      "type": "string"
                                    },
                                    "resultingCorpusVersionId": {
                                      "type": "string"
                                    },
                                    "resultingAutomationId": {
                                      "type": "string"
                                    },
                                    "entityKind": {
                                      "type": "string"
                                    },
                                    "entitySlug": {
                                      "type": "string"
                                    },
                                    "baseArtifactVersionId": {
                                      "type": "string"
                                    },
                                    "correctsEventId": {
                                      "type": "string"
                                    },
                                    "justification": {
                                      "type": "string"
                                    },
                                    "assertions": {
                                      "type": "array",
                                      "items": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "create_entity"
                                              },
                                              "entityKind": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "object",
                                                "properties": {
                                                  "documentId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "passage": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "quote": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "entityKind"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "retype"
                                              },
                                              "before": {
                                                "type": "string"
                                              },
                                              "after": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "object",
                                                "properties": {
                                                  "documentId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "passage": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "quote": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "before",
                                              "after"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "set_field"
                                              },
                                              "field": {
                                                "type": "string"
                                              },
                                              "before": {
                                                "type": "string"
                                              },
                                              "after": {
                                                "type": "string"
                                              },
                                              "source": {
                                                "type": "object",
                                                "properties": {
                                                  "documentId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "passage": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "quote": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "field"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "kind": {
                                                "type": "string",
                                                "const": "edit_body"
                                              },
                                              "source": {
                                                "type": "object",
                                                "properties": {
                                                  "documentId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "passage": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "quote": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "kind"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "assertionsOrigin": {
                                      "type": "string",
                                      "enum": [
                                        "emitted",
                                        "derived"
                                      ]
                                    },
                                    "mutationReview": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "index": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "kind": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "reversibility": {
                                            "type": "string",
                                            "enum": [
                                              "reversible",
                                              "lossy",
                                              "destructive"
                                            ]
                                          },
                                          "decision": {
                                            "type": "string",
                                            "enum": [
                                              "pending",
                                              "accepted",
                                              "rejected"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "index",
                                          "kind",
                                          "label",
                                          "reversibility",
                                          "decision"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "bodyHunkDecisions": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "pending",
                                          "accepted",
                                          "rejected"
                                        ]
                                      }
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureDetail": {},
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "itemType",
                                    "status",
                                    "createdAt",
                                    "updatedAt"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "changeset",
                              "items"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "reviewerCanAdopt": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "changesets",
                        "reviewerCanAdopt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/brains/{id}/durable-stream": {
      "get": {
        "operationId": "Brain_durableStream",
        "tags": [
          "Brain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "live",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sse",
                "long-poll"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events stream of run frames.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-triggers": {
      "get": {
        "operationId": "KnowledgeTrigger_list",
        "tags": [
          "KnowledgeTrigger"
        ],
        "parameters": [
          {
            "name": "knowledgeGraphId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "triggers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "expectedOutcome": {
                                "type": "string"
                              },
                              "requiredAccess": {
                                "type": "string",
                                "enum": [
                                  "read_only",
                                  "read_write"
                                ]
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "kindScopes": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "entityKind": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "changeTypes": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "created",
                                          "updated",
                                          "deleted"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "changeTypes"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "conditions": {
                                "type": "array",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "edge_count"
                                        },
                                        "edge": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "op": {
                                          "type": "string",
                                          "enum": [
                                            "gte",
                                            "eq",
                                            "lte"
                                          ]
                                        },
                                        "value": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "edge",
                                        "op",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "property"
                                        },
                                        "path": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "op": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "exists",
                                            "contains"
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "path",
                                        "op"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "inputTemplate": {
                                "type": "string"
                              },
                              "cooldownMinutes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "dailyCap": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "maxCausationDepth": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pausedAt": {
                                "type": "string"
                              },
                              "pausedReason": {
                                "type": "string"
                              },
                              "lastTestedFingerprint": {
                                "type": "string"
                              },
                              "lastTestRunId": {
                                "type": "string"
                              },
                              "lastTestOutcome": {
                                "type": "string",
                                "enum": [
                                  "passed",
                                  "failed"
                                ]
                              },
                              "lastTestSettledAt": {
                                "type": "string"
                              },
                              "lastTestPassedAt": {
                                "type": "string"
                              },
                              "firesToday": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "knowledgeGraphId",
                              "agentId",
                              "name",
                              "enabled",
                              "kindScopes",
                              "conditions",
                              "inputTemplate",
                              "cooldownMinutes",
                              "dailyCap",
                              "maxCausationDepth",
                              "firesToday",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "triggers"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "KnowledgeTrigger_create",
        "tags": [
          "KnowledgeTrigger"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expectedOutcome": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "requiredAccess": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "kindScopes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "entityKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "changeTypes": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "created",
                              "updated",
                              "deleted"
                            ]
                          }
                        }
                      },
                      "required": [
                        "changeTypes"
                      ]
                    }
                  },
                  "conditions": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "edge_count"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "gte",
                                "eq",
                                "lte"
                              ]
                            },
                            "value": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "type",
                            "edge",
                            "op",
                            "value"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "property"
                            },
                            "path": {
                              "type": "string",
                              "minLength": 1
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "eq",
                                "exists",
                                "contains"
                              ]
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "path",
                            "op"
                          ]
                        }
                      ]
                    }
                  },
                  "inputTemplate": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "cooldownMinutes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "dailyCap": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxCausationDepth": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "knowledgeGraphId",
                  "agentId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "trigger": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "kindScopes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "changeTypes": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "created",
                                        "updated",
                                        "deleted"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "changeTypes"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "conditions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "edge_count"
                                      },
                                      "edge": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "gte",
                                          "eq",
                                          "lte"
                                        ]
                                      },
                                      "value": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "edge",
                                      "op",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "path": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "exists",
                                          "contains"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "path",
                                      "op"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "inputTemplate": {
                              "type": "string"
                            },
                            "cooldownMinutes": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "dailyCap": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "maxCausationDepth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pausedAt": {
                              "type": "string"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestedFingerprint": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestOutcome": {
                              "type": "string",
                              "enum": [
                                "passed",
                                "failed"
                              ]
                            },
                            "lastTestSettledAt": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "firesToday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "enabled",
                            "kindScopes",
                            "conditions",
                            "inputTemplate",
                            "cooldownMinutes",
                            "dailyCap",
                            "maxCausationDepth",
                            "firesToday",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "trigger"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-triggers/{id}": {
      "patch": {
        "operationId": "KnowledgeTrigger_update",
        "tags": [
          "KnowledgeTrigger"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expectedOutcome": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "requiredAccess": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "kindScopes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "entityKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "changeTypes": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "created",
                              "updated",
                              "deleted"
                            ]
                          }
                        }
                      },
                      "required": [
                        "changeTypes"
                      ]
                    }
                  },
                  "conditions": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "edge_count"
                            },
                            "edge": {
                              "type": "string",
                              "minLength": 1
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "gte",
                                "eq",
                                "lte"
                              ]
                            },
                            "value": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "type",
                            "edge",
                            "op",
                            "value"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "property"
                            },
                            "path": {
                              "type": "string",
                              "minLength": 1
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "eq",
                                "exists",
                                "contains"
                              ]
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                }
                              ]
                            }
                          },
                          "required": [
                            "type",
                            "path",
                            "op"
                          ]
                        }
                      ]
                    }
                  },
                  "inputTemplate": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "cooldownMinutes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "dailyCap": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxCausationDepth": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "trigger": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "kindScopes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "changeTypes": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "created",
                                        "updated",
                                        "deleted"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "changeTypes"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "conditions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "edge_count"
                                      },
                                      "edge": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "gte",
                                          "eq",
                                          "lte"
                                        ]
                                      },
                                      "value": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "edge",
                                      "op",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "path": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "exists",
                                          "contains"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "path",
                                      "op"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "inputTemplate": {
                              "type": "string"
                            },
                            "cooldownMinutes": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "dailyCap": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "maxCausationDepth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pausedAt": {
                              "type": "string"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestedFingerprint": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestOutcome": {
                              "type": "string",
                              "enum": [
                                "passed",
                                "failed"
                              ]
                            },
                            "lastTestSettledAt": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "firesToday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "enabled",
                            "kindScopes",
                            "conditions",
                            "inputTemplate",
                            "cooldownMinutes",
                            "dailyCap",
                            "maxCausationDepth",
                            "firesToday",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "trigger"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "KnowledgeTrigger_delete",
        "tags": [
          "KnowledgeTrigger"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-triggers/{id}/resume": {
      "post": {
        "operationId": "KnowledgeTrigger_resume",
        "tags": [
          "KnowledgeTrigger"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "trigger": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "knowledgeGraphId": {
                              "type": "string"
                            },
                            "agentId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "kindScopes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entityKind": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "changeTypes": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "created",
                                        "updated",
                                        "deleted"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "changeTypes"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "conditions": {
                              "type": "array",
                              "items": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "edge_count"
                                      },
                                      "edge": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "gte",
                                          "eq",
                                          "lte"
                                        ]
                                      },
                                      "value": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "edge",
                                      "op",
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "property"
                                      },
                                      "path": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "exists",
                                          "contains"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "path",
                                      "op"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "inputTemplate": {
                              "type": "string"
                            },
                            "cooldownMinutes": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "dailyCap": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "maxCausationDepth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pausedAt": {
                              "type": "string"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestedFingerprint": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestOutcome": {
                              "type": "string",
                              "enum": [
                                "passed",
                                "failed"
                              ]
                            },
                            "lastTestSettledAt": {
                              "type": "string"
                            },
                            "lastTestPassedAt": {
                              "type": "string"
                            },
                            "firesToday": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "knowledgeGraphId",
                            "agentId",
                            "name",
                            "enabled",
                            "kindScopes",
                            "conditions",
                            "inputTemplate",
                            "cooldownMinutes",
                            "dailyCap",
                            "maxCausationDepth",
                            "firesToday",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "trigger"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/knowledge-triggers/{id}/fires": {
      "get": {
        "operationId": "KnowledgeTrigger_fires",
        "tags": [
          "KnowledgeTrigger"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "fires": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "triggerId": {
                                "type": "string"
                              },
                              "eventId": {
                                "type": "string"
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "entitySlug": {
                                "type": "string"
                              },
                              "entityNodeId": {
                                "type": "string"
                              },
                              "runId": {
                                "type": "string"
                              },
                              "causationDepth": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "dispatching",
                                  "fired",
                                  "failed"
                                ]
                              },
                              "failureReason": {
                                "type": "string"
                              },
                              "firedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "triggerId",
                              "eventId",
                              "knowledgeGraphId",
                              "entitySlug",
                              "causationDepth",
                              "status",
                              "firedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "fires"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/keys": {
      "post": {
        "operationId": "ManagementKeyV2_mint",
        "tags": [
          "ManagementKeyV2"
        ],
        "summary": "Mint a management key",
        "description": "The key reaches every Brain in one organization, and authorizes only while the user who minted it remains a member of that organization — removing that member stops the key on its next request. Mint from an account the organization keeps if the credential must outlive any one employee. The secret is returned exactly once and is never recoverable afterwards. `expiresAt`, if given, must be between 1 and 365 days in the future. This call is NOT idempotent: every call mints a new key. Requires a signed-in browser session: an `x-api-key` credential is refused with `403 forbidden`, because a key that can mint its own successor would outlive its own revocation. Sign in to the web app and mint from Settings, or drive this endpoint with the session cookie that sign-in returns.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "provisioning service"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "organizationId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "revoked"
                              ]
                            },
                            "lastUsedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "organizationId",
                            "status",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "secret": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "key",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "data": {
                    "key": {
                      "id": "key_2d90ff",
                      "name": "provisioning service",
                      "organizationId": "org_4471",
                      "status": "active",
                      "createdAt": "2026-08-14T09:15:41Z"
                    },
                    "secret": "nsk_…"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "ManagementKeyV2_list",
        "tags": [
          "ManagementKeyV2"
        ],
        "summary": "List management keys",
        "description": "Lists the management keys minted against the caller's organization, newest first, including revoked ones so an audit trail survives. No secret is ever returned here. Requires a signed-in browser session: an `x-api-key` credential is refused with `403 forbidden`, because a key that can mint its own successor would outlive its own revocation. Sign in to the web app and mint from Settings, or drive this endpoint with the session cookie that sign-in returns.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "keys": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "organizationId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "revoked"
                                ]
                              },
                              "lastUsedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "organizationId",
                              "status",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "keys"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/keys/{keyId}": {
      "delete": {
        "operationId": "ManagementKeyV2_revoke",
        "tags": [
          "ManagementKeyV2"
        ],
        "summary": "Revoke a management key",
        "description": "Revocation takes effect on the next request everywhere. It is idempotent: revoking an already-revoked key succeeds. A key that does not exist, or belongs to another organization, is `404 not_found` — existence is not disclosed. Requires a signed-in browser session: an `x-api-key` credential is refused with `403 forbidden`, because a key that can mint its own successor would outlive its own revocation. Sign in to the web app and mint from Settings, or drive this endpoint with the session cookie that sign-in returns.",
        "parameters": [
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "revoked": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "revoked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/notifications/subscribe": {
      "post": {
        "operationId": "Notification_subscribe",
        "tags": [
          "Notification"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "format": "uri"
                  },
                  "keys": {
                    "type": "object",
                    "properties": {
                      "p256dh": {
                        "type": "string",
                        "minLength": 1
                      },
                      "auth": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "p256dh",
                      "auth"
                    ]
                  }
                },
                "required": [
                  "endpoint",
                  "keys"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "subscription": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "subscription"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Notification_unsubscribe",
        "tags": [
          "Notification"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "endpoint"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/operations": {
      "get": {
        "operationId": "Operation_listByRun",
        "tags": [
          "Operation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operations": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "tool_call"
                                  },
                                  "toolSourceKind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "skill",
                                      "builtin"
                                    ]
                                  },
                                  "toolSourceId": {
                                    "type": "string"
                                  },
                                  "toolSourceVersionId": {
                                    "type": "string"
                                  },
                                  "toolName": {
                                    "type": "string"
                                  },
                                  "toolSchemaHash": {
                                    "type": "string"
                                  },
                                  "toolInputSchemaSnapshot": {},
                                  "toolOutputSchemaSnapshot": {}
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type",
                                  "toolSourceKind",
                                  "toolSourceId",
                                  "toolName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "llm_call"
                                  },
                                  "model": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "knowledgeReadSubject": {
                                    "type": "string",
                                    "enum": [
                                      "corpus",
                                      "knowledge_graph",
                                      "artifact",
                                      "chunk"
                                    ]
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "output": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "error": {
                                    "type": "string"
                                  },
                                  "attemptNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequence": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "producedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "consumedMessageIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "system_action"
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "status",
                                  "name",
                                  "sequence",
                                  "producedMessageIds",
                                  "consumedMessageIds",
                                  "createdAt",
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "operations"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Operation_create",
        "tags": [
          "Operation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "skillVersionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "tool_call",
                      "llm_call",
                      "system_action"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "input": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "type",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operation": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "tool_call"
                                },
                                "toolSourceKind": {
                                  "type": "string",
                                  "enum": [
                                    "connector",
                                    "skill",
                                    "builtin"
                                  ]
                                },
                                "toolSourceId": {
                                  "type": "string"
                                },
                                "toolSourceVersionId": {
                                  "type": "string"
                                },
                                "toolName": {
                                  "type": "string"
                                },
                                "toolSchemaHash": {
                                  "type": "string"
                                },
                                "toolInputSchemaSnapshot": {},
                                "toolOutputSchemaSnapshot": {}
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type",
                                "toolSourceKind",
                                "toolSourceId",
                                "toolName"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "llm_call"
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "system_action"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "operation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/operations/{operationId}": {
      "get": {
        "operationId": "Operation_get",
        "tags": [
          "Operation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operation": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "tool_call"
                                },
                                "toolSourceKind": {
                                  "type": "string",
                                  "enum": [
                                    "connector",
                                    "skill",
                                    "builtin"
                                  ]
                                },
                                "toolSourceId": {
                                  "type": "string"
                                },
                                "toolSourceVersionId": {
                                  "type": "string"
                                },
                                "toolName": {
                                  "type": "string"
                                },
                                "toolSchemaHash": {
                                  "type": "string"
                                },
                                "toolInputSchemaSnapshot": {},
                                "toolOutputSchemaSnapshot": {}
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type",
                                "toolSourceKind",
                                "toolSourceId",
                                "toolName"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "llm_call"
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "system_action"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "operation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/operations/{operationId}/complete": {
      "post": {
        "operationId": "Operation_complete",
        "tags": [
          "Operation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "output": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "error": {
                    "type": "string"
                  },
                  "inputTokens": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "outputTokens": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "latencyMs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operation": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "tool_call"
                                },
                                "toolSourceKind": {
                                  "type": "string",
                                  "enum": [
                                    "connector",
                                    "skill",
                                    "builtin"
                                  ]
                                },
                                "toolSourceId": {
                                  "type": "string"
                                },
                                "toolSourceVersionId": {
                                  "type": "string"
                                },
                                "toolName": {
                                  "type": "string"
                                },
                                "toolSchemaHash": {
                                  "type": "string"
                                },
                                "toolInputSchemaSnapshot": {},
                                "toolOutputSchemaSnapshot": {}
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type",
                                "toolSourceKind",
                                "toolSourceId",
                                "toolName"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "llm_call"
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "system_action"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "operation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/operations/{operationId}/abandon": {
      "post": {
        "operationId": "Operation_abandon",
        "tags": [
          "Operation"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "operation": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "tool_call"
                                },
                                "toolSourceKind": {
                                  "type": "string",
                                  "enum": [
                                    "connector",
                                    "skill",
                                    "builtin"
                                  ]
                                },
                                "toolSourceId": {
                                  "type": "string"
                                },
                                "toolSourceVersionId": {
                                  "type": "string"
                                },
                                "toolName": {
                                  "type": "string"
                                },
                                "toolSchemaHash": {
                                  "type": "string"
                                },
                                "toolInputSchemaSnapshot": {},
                                "toolOutputSchemaSnapshot": {}
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type",
                                "toolSourceKind",
                                "toolSourceId",
                                "toolName"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "llm_call"
                                },
                                "model": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "taskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "running",
                                    "succeeded",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "knowledgeReadSubject": {
                                  "type": "string",
                                  "enum": [
                                    "corpus",
                                    "knowledge_graph",
                                    "artifact",
                                    "chunk"
                                  ]
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "output": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "error": {
                                  "type": "string"
                                },
                                "attemptNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequence": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "producedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "consumedMessageIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "completedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "type": {
                                  "type": "string",
                                  "const": "system_action"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "status",
                                "name",
                                "sequence",
                                "producedMessageIds",
                                "consumedMessageIds",
                                "createdAt",
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "operation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs": {
      "get": {
        "operationId": "Pack_list",
        "tags": [
          "Pack"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "packs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "slug": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "source": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "git"
                                      },
                                      "url": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "ref": {
                                        "type": "string"
                                      },
                                      "sha": {
                                        "type": "string"
                                      },
                                      "path": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "archive"
                                      },
                                      "filename": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "sizeBytes": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "filename",
                                      "sizeBytes"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "upload"
                                      },
                                      "uploadedAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "byteHash": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "uploadedAt",
                                      "byteHash"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "const": "local"
                                      },
                                      "absolutePath": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "absolutePath"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "trustBoundary": {
                                "type": "string",
                                "enum": [
                                  "local",
                                  "tenant_private",
                                  "external_remote"
                                ]
                              },
                              "autoUpdate": {
                                "type": "boolean"
                              },
                              "currentVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "lifecycleState": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "errored",
                                  "uninstalled"
                                ]
                              },
                              "readinessRollup": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "active_degraded",
                                  "needs_setup"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "slug",
                              "namespace",
                              "name",
                              "source",
                              "trustBoundary",
                              "autoUpdate",
                              "lifecycleState",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "packs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Pack_create",
        "tags": [
          "Pack"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "namespace": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "source": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "git"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "ref": {
                            "type": "string"
                          },
                          "sha": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "url"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "archive"
                          },
                          "filename": {
                            "type": "string",
                            "minLength": 1
                          },
                          "sizeBytes": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "kind",
                          "filename",
                          "sizeBytes"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "upload"
                          },
                          "uploadedAt": {
                            "type": "string",
                            "minLength": 1
                          },
                          "byteHash": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "kind",
                          "uploadedAt",
                          "byteHash"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "local"
                          },
                          "absolutePath": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "kind",
                          "absolutePath"
                        ]
                      }
                    ]
                  },
                  "trustBoundary": {
                    "type": "string",
                    "enum": [
                      "local",
                      "tenant_private",
                      "external_remote"
                    ]
                  },
                  "autoUpdate": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "slug",
                  "namespace",
                  "name",
                  "source",
                  "trustBoundary"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pack": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "source": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "git"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "ref": {
                                      "type": "string"
                                    },
                                    "sha": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "archive"
                                    },
                                    "filename": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "sizeBytes": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "filename",
                                    "sizeBytes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "upload"
                                    },
                                    "uploadedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "byteHash": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "uploadedAt",
                                    "byteHash"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "local"
                                    },
                                    "absolutePath": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "absolutePath"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "trustBoundary": {
                              "type": "string",
                              "enum": [
                                "local",
                                "tenant_private",
                                "external_remote"
                              ]
                            },
                            "autoUpdate": {
                              "type": "boolean"
                            },
                            "currentVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored",
                                "uninstalled"
                              ]
                            },
                            "readinessRollup": {
                              "type": "string",
                              "enum": [
                                "active",
                                "active_degraded",
                                "needs_setup"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "namespace",
                            "name",
                            "source",
                            "trustBoundary",
                            "autoUpdate",
                            "lifecycleState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "pack"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs/{packId}": {
      "get": {
        "operationId": "Pack_get",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pack": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "source": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "git"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "ref": {
                                      "type": "string"
                                    },
                                    "sha": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "archive"
                                    },
                                    "filename": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "sizeBytes": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "filename",
                                    "sizeBytes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "upload"
                                    },
                                    "uploadedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "byteHash": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "uploadedAt",
                                    "byteHash"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "local"
                                    },
                                    "absolutePath": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "absolutePath"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "trustBoundary": {
                              "type": "string",
                              "enum": [
                                "local",
                                "tenant_private",
                                "external_remote"
                              ]
                            },
                            "autoUpdate": {
                              "type": "boolean"
                            },
                            "currentVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored",
                                "uninstalled"
                              ]
                            },
                            "readinessRollup": {
                              "type": "string",
                              "enum": [
                                "active",
                                "active_degraded",
                                "needs_setup"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "namespace",
                            "name",
                            "source",
                            "trustBoundary",
                            "autoUpdate",
                            "lifecycleState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceContentHash": {
                                "type": "string"
                              },
                              "materializationHash": {
                                "type": "string"
                              },
                              "sourceArtifactId": {
                                "type": "string"
                              },
                              "sourceArtifactVersionId": {
                                "type": "string"
                              },
                              "reportArtifactId": {
                                "type": "string"
                              },
                              "reportArtifactVersionId": {
                                "type": "string"
                              },
                              "compilerVersion": {
                                "type": "string"
                              },
                              "skillVersionIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "agentPromptVersionIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "memberSpecs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "agent",
                                        "skill"
                                      ]
                                    },
                                    "upstreamKey": {
                                      "type": "string"
                                    },
                                    "resolvedHandleId": {
                                      "type": "string"
                                    },
                                    "resolvedVersionId": {
                                      "type": "string"
                                    },
                                    "policySnapshot": {},
                                    "blockingRequirementKeys": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "upstreamKey",
                                    "resolvedHandleId",
                                    "resolvedVersionId",
                                    "policySnapshot",
                                    "blockingRequirementKeys"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "topologySpecs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "alias": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    },
                                    "description": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "defaultWaitPolicy": {
                                      "default": "wait_for_result",
                                      "type": "string",
                                      "enum": [
                                        "wait_for_result",
                                        "fire_and_forget"
                                      ]
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxConcurrentRuns": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "sourceUpstreamKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "targetUpstreamKey": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "alias",
                                    "defaultWaitPolicy",
                                    "sourceUpstreamKey",
                                    "targetUpstreamKey"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "requirements": {
                                "type": "array",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "connector"
                                        },
                                        "key": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "connectorKind": {
                                          "type": "string",
                                          "enum": [
                                            "mcp_server",
                                            "http_endpoint",
                                            "webhook_outbound"
                                          ]
                                        },
                                        "requiredTools": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "optional": {
                                          "default": false,
                                          "type": "boolean"
                                        },
                                        "memberScope": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "trustBoundary": {
                                          "type": "string",
                                          "enum": [
                                            "local",
                                            "tenant_private",
                                            "external_remote"
                                          ]
                                        },
                                        "policyDefaults": {
                                          "type": "object",
                                          "properties": {
                                            "trustBoundary": {
                                              "type": "string",
                                              "enum": [
                                                "local",
                                                "tenant_private",
                                                "external_remote"
                                              ]
                                            },
                                            "allowedAgentIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "allowedToolNames": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "rateLimitPerMinute": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "budgetCents": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "key",
                                        "connectorKind",
                                        "requiredTools",
                                        "optional",
                                        "memberScope",
                                        "trustBoundary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "corpus"
                                        },
                                        "key": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "retrievalModes": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "optional": {
                                          "default": false,
                                          "type": "boolean"
                                        },
                                        "memberScope": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "key",
                                        "retrievalModes",
                                        "optional",
                                        "memberScope"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "policyDefaults": {},
                              "changeSetId": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "packId",
                              "sourceContentHash",
                              "materializationHash",
                              "sourceArtifactId",
                              "sourceArtifactVersionId",
                              "reportArtifactId",
                              "reportArtifactVersionId",
                              "compilerVersion",
                              "skillVersionIds",
                              "agentPromptVersionIds",
                              "memberSpecs",
                              "topologySpecs",
                              "requirements",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "bindings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "requirementKey": {
                                "type": "string"
                              },
                              "connectorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "corpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "enabledTools": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "policyOverrides": {},
                              "boundBy": {
                                "type": "string"
                              },
                              "boundAt": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "errored"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "packId",
                              "requirementKey",
                              "boundBy",
                              "boundAt",
                              "state",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "members": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "memberKind": {
                                "type": "string",
                                "enum": [
                                  "agent",
                                  "skill"
                                ]
                              },
                              "upstreamKey": {
                                "type": "string"
                              },
                              "resolvedHandleId": {
                                "type": "string"
                              },
                              "resolvedVersionId": {
                                "type": "string"
                              },
                              "addressName": {
                                "type": "string"
                              },
                              "blockingRequirementKeys": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "managed",
                                  "forked"
                                ]
                              },
                              "readiness": {
                                "type": "string",
                                "enum": [
                                  "ready",
                                  "blocked_on_setup",
                                  "errored"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "packId",
                              "packVersionId",
                              "memberKind",
                              "upstreamKey",
                              "resolvedHandleId",
                              "resolvedVersionId",
                              "addressName",
                              "blockingRequirementKeys",
                              "state",
                              "readiness",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "pack",
                        "versions",
                        "bindings",
                        "members"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Pack_update",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string"
                  },
                  "trustBoundary": {
                    "type": "string",
                    "enum": [
                      "local",
                      "tenant_private",
                      "external_remote"
                    ]
                  },
                  "autoUpdate": {
                    "type": "boolean"
                  },
                  "currentVersionId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pack": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "source": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "git"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "ref": {
                                      "type": "string"
                                    },
                                    "sha": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "archive"
                                    },
                                    "filename": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "sizeBytes": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "filename",
                                    "sizeBytes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "upload"
                                    },
                                    "uploadedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "byteHash": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "uploadedAt",
                                    "byteHash"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "local"
                                    },
                                    "absolutePath": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "absolutePath"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "trustBoundary": {
                              "type": "string",
                              "enum": [
                                "local",
                                "tenant_private",
                                "external_remote"
                              ]
                            },
                            "autoUpdate": {
                              "type": "boolean"
                            },
                            "currentVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored",
                                "uninstalled"
                              ]
                            },
                            "readinessRollup": {
                              "type": "string",
                              "enum": [
                                "active",
                                "active_degraded",
                                "needs_setup"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "namespace",
                            "name",
                            "source",
                            "trustBoundary",
                            "autoUpdate",
                            "lifecycleState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "pack"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Pack_delete",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pack": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "source": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "git"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "ref": {
                                      "type": "string"
                                    },
                                    "sha": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "archive"
                                    },
                                    "filename": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "sizeBytes": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "filename",
                                    "sizeBytes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "upload"
                                    },
                                    "uploadedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "byteHash": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "uploadedAt",
                                    "byteHash"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "local"
                                    },
                                    "absolutePath": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "absolutePath"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "trustBoundary": {
                              "type": "string",
                              "enum": [
                                "local",
                                "tenant_private",
                                "external_remote"
                              ]
                            },
                            "autoUpdate": {
                              "type": "boolean"
                            },
                            "currentVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored",
                                "uninstalled"
                              ]
                            },
                            "readinessRollup": {
                              "type": "string",
                              "enum": [
                                "active",
                                "active_degraded",
                                "needs_setup"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "namespace",
                            "name",
                            "source",
                            "trustBoundary",
                            "autoUpdate",
                            "lifecycleState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "pack"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs/{packId}/uninstall": {
      "post": {
        "operationId": "Pack_uninstall",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pack": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "source": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "git"
                                    },
                                    "url": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "ref": {
                                      "type": "string"
                                    },
                                    "sha": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "archive"
                                    },
                                    "filename": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "sizeBytes": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "filename",
                                    "sizeBytes"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "upload"
                                    },
                                    "uploadedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "byteHash": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "uploadedAt",
                                    "byteHash"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "local"
                                    },
                                    "absolutePath": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "absolutePath"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "trustBoundary": {
                              "type": "string",
                              "enum": [
                                "local",
                                "tenant_private",
                                "external_remote"
                              ]
                            },
                            "autoUpdate": {
                              "type": "boolean"
                            },
                            "currentVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored",
                                "uninstalled"
                              ]
                            },
                            "readinessRollup": {
                              "type": "string",
                              "enum": [
                                "active",
                                "active_degraded",
                                "needs_setup"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "slug",
                            "namespace",
                            "name",
                            "source",
                            "trustBoundary",
                            "autoUpdate",
                            "lifecycleState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "pack"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs/{packId}/versions": {
      "get": {
        "operationId": "Pack_listVersions",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceContentHash": {
                                "type": "string"
                              },
                              "materializationHash": {
                                "type": "string"
                              },
                              "sourceArtifactId": {
                                "type": "string"
                              },
                              "sourceArtifactVersionId": {
                                "type": "string"
                              },
                              "reportArtifactId": {
                                "type": "string"
                              },
                              "reportArtifactVersionId": {
                                "type": "string"
                              },
                              "compilerVersion": {
                                "type": "string"
                              },
                              "skillVersionIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "agentPromptVersionIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "memberSpecs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "agent",
                                        "skill"
                                      ]
                                    },
                                    "upstreamKey": {
                                      "type": "string"
                                    },
                                    "resolvedHandleId": {
                                      "type": "string"
                                    },
                                    "resolvedVersionId": {
                                      "type": "string"
                                    },
                                    "policySnapshot": {},
                                    "blockingRequirementKeys": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "upstreamKey",
                                    "resolvedHandleId",
                                    "resolvedVersionId",
                                    "policySnapshot",
                                    "blockingRequirementKeys"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "topologySpecs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "alias": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    },
                                    "description": {
                                      "type": "string",
                                      "maxLength": 1000
                                    },
                                    "defaultWaitPolicy": {
                                      "default": "wait_for_result",
                                      "type": "string",
                                      "enum": [
                                        "wait_for_result",
                                        "fire_and_forget"
                                      ]
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxConcurrentRuns": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "sourceUpstreamKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "targetUpstreamKey": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "alias",
                                    "defaultWaitPolicy",
                                    "sourceUpstreamKey",
                                    "targetUpstreamKey"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "requirements": {
                                "type": "array",
                                "items": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "connector"
                                        },
                                        "key": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "connectorKind": {
                                          "type": "string",
                                          "enum": [
                                            "mcp_server",
                                            "http_endpoint",
                                            "webhook_outbound"
                                          ]
                                        },
                                        "requiredTools": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "optional": {
                                          "default": false,
                                          "type": "boolean"
                                        },
                                        "memberScope": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "trustBoundary": {
                                          "type": "string",
                                          "enum": [
                                            "local",
                                            "tenant_private",
                                            "external_remote"
                                          ]
                                        },
                                        "policyDefaults": {
                                          "type": "object",
                                          "properties": {
                                            "trustBoundary": {
                                              "type": "string",
                                              "enum": [
                                                "local",
                                                "tenant_private",
                                                "external_remote"
                                              ]
                                            },
                                            "allowedAgentIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "allowedToolNames": {
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "rateLimitPerMinute": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "budgetCents": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "key",
                                        "connectorKind",
                                        "requiredTools",
                                        "optional",
                                        "memberScope",
                                        "trustBoundary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "const": "corpus"
                                        },
                                        "key": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 120
                                        },
                                        "retrievalModes": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        },
                                        "optional": {
                                          "default": false,
                                          "type": "boolean"
                                        },
                                        "memberScope": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "key",
                                        "retrievalModes",
                                        "optional",
                                        "memberScope"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "policyDefaults": {},
                              "changeSetId": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "packId",
                              "sourceContentHash",
                              "materializationHash",
                              "sourceArtifactId",
                              "sourceArtifactVersionId",
                              "reportArtifactId",
                              "reportArtifactVersionId",
                              "compilerVersion",
                              "skillVersionIds",
                              "agentPromptVersionIds",
                              "memberSpecs",
                              "topologySpecs",
                              "requirements",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "versions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs/{packId}/bindings": {
      "get": {
        "operationId": "Pack_listBindings",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "bindings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "packId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "requirementKey": {
                                "type": "string"
                              },
                              "connectorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "corpusId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "enabledTools": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "policyOverrides": {},
                              "boundBy": {
                                "type": "string"
                              },
                              "boundAt": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "errored"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "packId",
                              "requirementKey",
                              "boundBy",
                              "boundAt",
                              "state",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "bindings"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/packs/{packId}/bindings/{requirementKey}": {
      "put": {
        "operationId": "Pack_bindRequirement",
        "tags": [
          "Pack"
        ],
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "requirementKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "connectorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "corpusId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabledTools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "policyOverrides": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "binding": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "packId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "requirementKey": {
                              "type": "string"
                            },
                            "connectorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "enabledTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "policyOverrides": {},
                            "boundBy": {
                              "type": "string"
                            },
                            "boundAt": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "active",
                                "errored"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "packId",
                            "requirementKey",
                            "boundBy",
                            "boundAt",
                            "state",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "binding"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "Project_list",
        "tags": [
          "Project"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64,
                                "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "policy": {
                                "type": "object",
                                "properties": {
                                  "defaultModelRoutingPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "preferredProviderId": {
                                        "type": "string"
                                      },
                                      "credentialId": {
                                        "type": "string"
                                      },
                                      "allowPlatformCredentials": {
                                        "type": "boolean"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "monthlyBudgetCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "changeSetPromotionRoles": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "owner",
                                        "admin",
                                        "editor",
                                        "runner",
                                        "viewer"
                                      ]
                                    }
                                  },
                                  "agentInvocationBindingRoles": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "owner",
                                        "admin",
                                        "editor",
                                        "runner",
                                        "viewer"
                                      ]
                                    }
                                  },
                                  "defaultVisibility": {
                                    "default": "project",
                                    "type": "string",
                                    "enum": [
                                      "project",
                                      "organization"
                                    ]
                                  }
                                },
                                "required": [
                                  "defaultVisibility"
                                ],
                                "additionalProperties": false
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "slug",
                              "name",
                              "description",
                              "policy",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "projects"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Project_create",
        "tags": [
          "Project"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "defaultModelRoutingPolicy": {
                        "type": "object",
                        "properties": {
                          "preferredProviderId": {
                            "type": "string"
                          },
                          "credentialId": {
                            "type": "string"
                          },
                          "allowPlatformCredentials": {
                            "type": "boolean"
                          }
                        }
                      },
                      "monthlyBudgetCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "changeSetPromotionRoles": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "editor",
                            "runner",
                            "viewer"
                          ]
                        }
                      },
                      "agentInvocationBindingRoles": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "editor",
                            "runner",
                            "viewer"
                          ]
                        }
                      },
                      "defaultVisibility": {
                        "default": "project",
                        "type": "string",
                        "enum": [
                          "project",
                          "organization"
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "slug",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "defaultModelRoutingPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "preferredProviderId": {
                                      "type": "string"
                                    },
                                    "credentialId": {
                                      "type": "string"
                                    },
                                    "allowPlatformCredentials": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "monthlyBudgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetPromotionRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "agentInvocationBindingRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "defaultVisibility": {
                                  "default": "project",
                                  "type": "string",
                                  "enum": [
                                    "project",
                                    "organization"
                                  ]
                                }
                              },
                              "required": [
                                "defaultVisibility"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name",
                            "description",
                            "policy",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "project"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/default": {
      "post": {
        "operationId": "Project_ensureDefault",
        "tags": [
          "Project"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "defaultModelRoutingPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "preferredProviderId": {
                                      "type": "string"
                                    },
                                    "credentialId": {
                                      "type": "string"
                                    },
                                    "allowPlatformCredentials": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "monthlyBudgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetPromotionRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "agentInvocationBindingRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "defaultVisibility": {
                                  "default": "project",
                                  "type": "string",
                                  "enum": [
                                    "project",
                                    "organization"
                                  ]
                                }
                              },
                              "required": [
                                "defaultVisibility"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name",
                            "description",
                            "policy",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "project"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "operationId": "Project_get",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "defaultModelRoutingPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "preferredProviderId": {
                                      "type": "string"
                                    },
                                    "credentialId": {
                                      "type": "string"
                                    },
                                    "allowPlatformCredentials": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "monthlyBudgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetPromotionRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "agentInvocationBindingRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "defaultVisibility": {
                                  "default": "project",
                                  "type": "string",
                                  "enum": [
                                    "project",
                                    "organization"
                                  ]
                                }
                              },
                              "required": [
                                "defaultVisibility"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name",
                            "description",
                            "policy",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "project"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "Project_update",
        "tags": [
          "Project"
        ],
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "defaultModelRoutingPolicy": {
                        "type": "object",
                        "properties": {
                          "preferredProviderId": {
                            "type": "string"
                          },
                          "credentialId": {
                            "type": "string"
                          },
                          "allowPlatformCredentials": {
                            "type": "boolean"
                          }
                        }
                      },
                      "monthlyBudgetCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "changeSetPromotionRoles": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "editor",
                            "runner",
                            "viewer"
                          ]
                        }
                      },
                      "agentInvocationBindingRoles": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "editor",
                            "runner",
                            "viewer"
                          ]
                        }
                      },
                      "defaultVisibility": {
                        "default": "project",
                        "type": "string",
                        "enum": [
                          "project",
                          "organization"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "slug": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "defaultModelRoutingPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "preferredProviderId": {
                                      "type": "string"
                                    },
                                    "credentialId": {
                                      "type": "string"
                                    },
                                    "allowPlatformCredentials": {
                                      "type": "boolean"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "monthlyBudgetCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "changeSetPromotionRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "agentInvocationBindingRoles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "editor",
                                      "runner",
                                      "viewer"
                                    ]
                                  }
                                },
                                "defaultVisibility": {
                                  "default": "project",
                                  "type": "string",
                                  "enum": [
                                    "project",
                                    "organization"
                                  ]
                                }
                              },
                              "required": [
                                "defaultVisibility"
                              ],
                              "additionalProperties": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name",
                            "description",
                            "policy",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "project"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/provider-credentials": {
      "get": {
        "operationId": "ProviderCredential_list",
        "tags": [
          "ProviderCredential"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "credentials": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "providerId": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "lastUsedAt": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "providerId",
                              "label",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "credentials"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "ProviderCredential_create",
        "tags": [
          "ProviderCredential"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "providerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "apiKey": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "providerId",
                  "label",
                  "apiKey"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "credential": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "credential"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/provider-credentials/providers": {
      "get": {
        "operationId": "ProviderCredential_providers",
        "tags": [
          "ProviderCredential"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "providers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "label"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "providers"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/provider-credentials/{id}": {
      "delete": {
        "operationId": "ProviderCredential_delete",
        "tags": [
          "ProviderCredential"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/provider-credentials/{id}/test": {
      "post": {
        "operationId": "ProviderCredential_test",
        "tags": [
          "ProviderCredential"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "test": {
                          "type": "object",
                          "properties": {
                            "ok": {
                              "type": "boolean"
                            },
                            "status": {
                              "type": "number"
                            },
                            "error": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "ok"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "test"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/query": {
      "post": {
        "operationId": "Query_queryKnowledge",
        "tags": [
          "Query"
        ],
        "parameters": [
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "schemaSlug": {
                    "type": "string",
                    "minLength": 1
                  },
                  "queryText": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "occurredAfter": {
                    "type": "string"
                  },
                  "occurredBefore": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 25
                  }
                },
                "required": [
                  "schemaSlug",
                  "queryText"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "object",
                          "properties": {
                            "schemaSlug": {
                              "type": "string"
                            },
                            "queryText": {
                              "type": "string"
                            },
                            "matches": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "occurredAt": {
                                    "type": "string"
                                  },
                                  "snippet": {
                                    "type": "string"
                                  },
                                  "sourceUrl": {
                                    "type": "string"
                                  },
                                  "score": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1
                                  },
                                  "provenance": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "edge": {
                                          "type": "string"
                                        },
                                        "toKind": {
                                          "type": "string"
                                        },
                                        "toId": {
                                          "type": "string"
                                        },
                                        "toTitle": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "edge",
                                        "toKind",
                                        "toId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "sourceChunkIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "sourceSupportCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "title",
                                  "score",
                                  "provenance"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "schemaSlug",
                            "queryText",
                            "matches"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "result"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/rubric-templates": {
      "get": {
        "operationId": "RubricTemplate_list",
        "tags": [
          "RubricTemplate"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "templates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "dimensions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "dimension": {
                                      "type": "string"
                                    },
                                    "criteria": {
                                      "type": "string"
                                    },
                                    "weight": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "dimension",
                                    "criteria",
                                    "weight"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "dimensions"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "templates"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/rubric-templates/generate": {
      "post": {
        "operationId": "RubricTemplate_generate",
        "tags": [
          "RubricTemplate"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "dimensions": {
                          "minItems": 3,
                          "maxItems": 6,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "dimension": {
                                "type": "string"
                              },
                              "criteria": {
                                "type": "string"
                              },
                              "weight": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "dimension",
                              "criteria",
                              "weight"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "dimensions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/search": {
      "post": {
        "operationId": "Search_searchBrains",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "x-external-run-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Self-reported correlation id. Sanitized and truncated to 200 characters server-side; never rejected for length."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "fulltext",
                      "hybrid"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 25
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "query": {
                          "type": "string"
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "artifactId": {
                                "type": "string"
                              },
                              "artifactName": {
                                "type": "string"
                              },
                              "snippet": {
                                "type": "string"
                              },
                              "rank": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "citeToken": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "artifactId",
                              "artifactName",
                              "snippet",
                              "rank",
                              "citeToken"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "query",
                        "results"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/tasks/{taskId}/respond": {
      "post": {
        "operationId": "RunTask_respond",
        "tags": [
          "RunTask"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "response": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "approval"
                          },
                          "decision": {
                            "type": "string",
                            "enum": [
                              "approved",
                              "rejected"
                            ]
                          },
                          "note": {
                            "type": "string",
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "decision"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "selection"
                          },
                          "optionIds": {
                            "minItems": 1,
                            "maxItems": 50,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "note": {
                            "type": "string",
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "optionIds"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "freeform"
                          },
                          "text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20000
                          }
                        },
                        "required": [
                          "kind",
                          "text"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "structured"
                          },
                          "value": {}
                        },
                        "required": [
                          "kind",
                          "value"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "response"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "task": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentTaskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "tool",
                                "skill",
                                "human_input",
                                "child_run",
                                "external_wait"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed",
                                "abandoned",
                                "skipped",
                                "cancelled"
                              ]
                            },
                            "sequenceNumber": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skillName": {
                              "type": "string"
                            },
                            "skillVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "request": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "tool"
                                    },
                                    "toolName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "args": {},
                                    "toolUseId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "toolName",
                                    "args"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "skillHandle": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "context": {}
                                  },
                                  "required": [
                                    "role",
                                    "skillHandle",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "approval"
                                        },
                                        "proposedActionSummary": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "approvalSubject": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "skill_activation"
                                                },
                                                "skillHandle": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "skillHandle",
                                                "skillId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "tool_activation"
                                                },
                                                "toolName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "connectorId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "args": {}
                                                  },
                                                  "required": [
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "toolName",
                                                "connectorId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "proposedActionSummary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "selection"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "description": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "allowMultiple": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "options"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "freeform"
                                        },
                                        "responseHint": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "structured"
                                        },
                                        "responseSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "responseSchema"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "title": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "expectedOutputSchema": {},
                                    "delegationReason": {
                                      "type": "string"
                                    },
                                    "resumePolicy": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "all"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "any"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "count"
                                            },
                                            "requiredCount": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "requiredCount"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "prompt",
                                    "agentId",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string"
                                    },
                                    "expectedPayloadSchema": {},
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "result": {
                              "oneOf": [
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "completed"
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "waiting"
                                        },
                                        "waitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "waitGroupId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "waitId",
                                        "waitGroupId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "failed",
                                            "skipped",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "enum": [
                                        "completed",
                                        "failed",
                                        "abandoned",
                                        "cancelled"
                                      ]
                                    },
                                    "output": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "outcome"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "human_input"
                                    },
                                    "runWaitId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "requestTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responder": {
                                      "type": "object",
                                      "properties": {
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "tenantId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "roleIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "userId",
                                        "tenantId",
                                        "roleIds"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "respondedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decision": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "approved"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "rejected"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "selected"
                                            },
                                            "optionIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "text": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "value": {}
                                          },
                                          "required": [
                                            "type",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runWaitId",
                                    "requestTaskId",
                                    "responder",
                                    "respondedAt",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "type": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "workspacePath": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "role",
                                    "childRunId",
                                    "finalState",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "occurredAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "data": {},
                                    "producer": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "responderId": {
                              "type": "string"
                            },
                            "claimedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "claimedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "childRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "groupId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "status",
                            "sequenceNumber",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "task"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/tasks/{taskId}/claim": {
      "post": {
        "operationId": "RunTask_claim",
        "tags": [
          "RunTask"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "task": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentTaskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "tool",
                                "skill",
                                "human_input",
                                "child_run",
                                "external_wait"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed",
                                "abandoned",
                                "skipped",
                                "cancelled"
                              ]
                            },
                            "sequenceNumber": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skillName": {
                              "type": "string"
                            },
                            "skillVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "request": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "tool"
                                    },
                                    "toolName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "args": {},
                                    "toolUseId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "toolName",
                                    "args"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "skillHandle": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "context": {}
                                  },
                                  "required": [
                                    "role",
                                    "skillHandle",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "approval"
                                        },
                                        "proposedActionSummary": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "approvalSubject": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "skill_activation"
                                                },
                                                "skillHandle": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "skillHandle",
                                                "skillId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "tool_activation"
                                                },
                                                "toolName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "connectorId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "args": {}
                                                  },
                                                  "required": [
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "toolName",
                                                "connectorId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "proposedActionSummary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "selection"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "description": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "allowMultiple": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "options"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "freeform"
                                        },
                                        "responseHint": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "structured"
                                        },
                                        "responseSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "responseSchema"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "title": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "expectedOutputSchema": {},
                                    "delegationReason": {
                                      "type": "string"
                                    },
                                    "resumePolicy": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "all"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "any"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "count"
                                            },
                                            "requiredCount": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "requiredCount"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "prompt",
                                    "agentId",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string"
                                    },
                                    "expectedPayloadSchema": {},
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "result": {
                              "oneOf": [
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "completed"
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "waiting"
                                        },
                                        "waitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "waitGroupId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "waitId",
                                        "waitGroupId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "failed",
                                            "skipped",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "enum": [
                                        "completed",
                                        "failed",
                                        "abandoned",
                                        "cancelled"
                                      ]
                                    },
                                    "output": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "outcome"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "human_input"
                                    },
                                    "runWaitId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "requestTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responder": {
                                      "type": "object",
                                      "properties": {
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "tenantId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "roleIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "userId",
                                        "tenantId",
                                        "roleIds"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "respondedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decision": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "approved"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "rejected"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "selected"
                                            },
                                            "optionIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "text": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "value": {}
                                          },
                                          "required": [
                                            "type",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runWaitId",
                                    "requestTaskId",
                                    "responder",
                                    "respondedAt",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "type": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "workspacePath": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "role",
                                    "childRunId",
                                    "finalState",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "occurredAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "data": {},
                                    "producer": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "responderId": {
                              "type": "string"
                            },
                            "claimedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "claimedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "childRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "groupId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "status",
                            "sequenceNumber",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "task"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/tasks/{taskId}/release": {
      "post": {
        "operationId": "RunTask_release",
        "tags": [
          "RunTask"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "task": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentTaskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "tool",
                                "skill",
                                "human_input",
                                "child_run",
                                "external_wait"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed",
                                "abandoned",
                                "skipped",
                                "cancelled"
                              ]
                            },
                            "sequenceNumber": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skillName": {
                              "type": "string"
                            },
                            "skillVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "request": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "tool"
                                    },
                                    "toolName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "args": {},
                                    "toolUseId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "toolName",
                                    "args"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "skillHandle": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "context": {}
                                  },
                                  "required": [
                                    "role",
                                    "skillHandle",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "approval"
                                        },
                                        "proposedActionSummary": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "approvalSubject": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "skill_activation"
                                                },
                                                "skillHandle": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "skillHandle",
                                                "skillId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "tool_activation"
                                                },
                                                "toolName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "connectorId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "args": {}
                                                  },
                                                  "required": [
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "toolName",
                                                "connectorId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "proposedActionSummary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "selection"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "description": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "allowMultiple": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "options"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "freeform"
                                        },
                                        "responseHint": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "structured"
                                        },
                                        "responseSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "responseSchema"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "title": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "expectedOutputSchema": {},
                                    "delegationReason": {
                                      "type": "string"
                                    },
                                    "resumePolicy": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "all"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "any"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "count"
                                            },
                                            "requiredCount": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "requiredCount"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "prompt",
                                    "agentId",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string"
                                    },
                                    "expectedPayloadSchema": {},
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "result": {
                              "oneOf": [
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "completed"
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "waiting"
                                        },
                                        "waitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "waitGroupId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "waitId",
                                        "waitGroupId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "failed",
                                            "skipped",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "enum": [
                                        "completed",
                                        "failed",
                                        "abandoned",
                                        "cancelled"
                                      ]
                                    },
                                    "output": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "outcome"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "human_input"
                                    },
                                    "runWaitId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "requestTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responder": {
                                      "type": "object",
                                      "properties": {
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "tenantId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "roleIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "userId",
                                        "tenantId",
                                        "roleIds"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "respondedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decision": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "approved"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "rejected"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "selected"
                                            },
                                            "optionIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "text": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "value": {}
                                          },
                                          "required": [
                                            "type",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runWaitId",
                                    "requestTaskId",
                                    "responder",
                                    "respondedAt",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "type": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "workspacePath": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "role",
                                    "childRunId",
                                    "finalState",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "occurredAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "data": {},
                                    "producer": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "responderId": {
                              "type": "string"
                            },
                            "claimedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "claimedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "childRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "groupId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "status",
                            "sequenceNumber",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "task"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs": {
      "get": {
        "operationId": "Run_list",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "active",
                "closed",
                "failed",
                "abandoned"
              ]
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "runs": {
                          "type": "array",
                          "items": {
                            "allOf": [
                              {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "pending"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "active"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "closed"
                                      },
                                      "output": {}
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "failed"
                                      },
                                      "failureReason": {
                                        "type": "string"
                                      },
                                      "failureCategory": {
                                        "type": "string",
                                        "enum": [
                                          "provider_error",
                                          "invariant_violation",
                                          "unhandled_exception",
                                          "dependency_unavailable"
                                        ]
                                      },
                                      "failureDetail": {}
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state",
                                      "failureReason",
                                      "failureCategory"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "abandoned"
                                      },
                                      "abandonReason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state",
                                      "abandonReason"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "displayState": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "waiting",
                                      "idle",
                                      "closed",
                                      "failed",
                                      "abandoned"
                                    ]
                                  }
                                },
                                "required": [
                                  "displayState"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "runs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_create",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Dedupe key, namespaced per user within the tenant (another user sending the same key gets their own independent run). Retrying with the same key and the SAME request body returns the same run instead of starting a new one. Reusing a key with a different body (agentId, input, runtimePolicy, pinnedVersions, conversationId) returns a 409 `conflict` error — use a fresh key for a new request.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Prefer",
            "in": "header",
            "required": false,
            "description": "`wait=<seconds>` blocks until the run reaches a terminal state or the deadline (default 60s, max 120s); past the deadline the still-active run is returned so you poll or stream onward.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "input": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "pinnedVersions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "runtimePolicy": {
                    "type": "object",
                    "properties": {
                      "sandboxLifecycle": {
                        "type": "string",
                        "enum": [
                          "ephemeral_per_turn",
                          "snapshot_to_r2",
                          "warm_per_run"
                        ]
                      },
                      "executionRuntime": {
                        "default": "none",
                        "type": "string",
                        "enum": [
                          "none",
                          "fast_virtual",
                          "dynamic_worker",
                          "required_full_os"
                        ]
                      },
                      "workspaceMode": {
                        "default": "none",
                        "type": "string",
                        "enum": [
                          "none",
                          "persistent"
                        ]
                      },
                      "directToolPolicy": {
                        "type": "object",
                        "properties": {
                          "workspaceWritePrefixes": {
                            "maxItems": 100,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "destructiveCommands": {
                            "default": "allow",
                            "type": "string",
                            "enum": [
                              "allow",
                              "deny"
                            ]
                          },
                          "codemode": {
                            "type": "object",
                            "properties": {
                              "enabled": {
                                "default": true,
                                "type": "boolean"
                              },
                              "minEligibleTools": {
                                "default": 5,
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 1000
                              },
                              "timeoutMs": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            }
                          }
                        }
                      },
                      "automationTest": {
                        "type": "boolean"
                      },
                      "automationRun": {
                        "type": "boolean"
                      },
                      "automationBrainAccess": {
                        "type": "string",
                        "enum": [
                          "read_only",
                          "read_write"
                        ]
                      },
                      "automationKnowledgeGraphId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "sandboxLifecycle"
                    ]
                  },
                  "conversationId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}": {
      "get": {
        "operationId": "Run_get",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "pendingTasks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "parentTaskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "tool",
                                  "skill",
                                  "human_input",
                                  "child_run",
                                  "external_wait"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "completed",
                                  "failed",
                                  "abandoned",
                                  "skipped",
                                  "cancelled"
                                ]
                              },
                              "sequenceNumber": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "skillName": {
                                "type": "string"
                              },
                              "skillVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "input": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "tool"
                                      },
                                      "toolName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "args": {},
                                      "toolUseId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "toolName",
                                      "args"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "skillHandle": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "context": {}
                                    },
                                    "required": [
                                      "role",
                                      "skillHandle",
                                      "input"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "approval"
                                          },
                                          "proposedActionSummary": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "approvalSubject": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "skill_activation"
                                                  },
                                                  "skillHandle": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillVersionId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "input": {},
                                                      "artifactIds": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "context": {}
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "skillHandle",
                                                  "skillId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "tool_activation"
                                                  },
                                                  "toolName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "connectorId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "args": {}
                                                    },
                                                    "required": [
                                                      "args"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "toolName",
                                                  "connectorId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "proposedActionSummary"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "selection"
                                          },
                                          "options": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "description": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "allowMultiple": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "options"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "freeform"
                                          },
                                          "responseHint": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "structured"
                                          },
                                          "responseSchema": {}
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "responseSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "agentId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "title": {
                                        "type": "string"
                                      },
                                      "runtimeHint": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "expectedOutputSchema": {},
                                      "delegationReason": {
                                        "type": "string"
                                      },
                                      "resumePolicy": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "all"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "any"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "count"
                                              },
                                              "requiredCount": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "requiredCount"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "prompt",
                                      "agentId",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string"
                                      },
                                      "expectedPayloadSchema": {},
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "result": {
                                "oneOf": [
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "completed"
                                          },
                                          "output": {},
                                          "artifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "waiting"
                                          },
                                          "waitId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "waitGroupId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "waitId",
                                          "waitGroupId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "enum": [
                                              "failed",
                                              "skipped",
                                              "abandoned",
                                              "cancelled"
                                            ]
                                          },
                                          "reason": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "reason"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "outcome": {
                                        "type": "string",
                                        "enum": [
                                          "completed",
                                          "failed",
                                          "abandoned",
                                          "cancelled"
                                        ]
                                      },
                                      "output": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "outcome"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "runWaitId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "requestTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responder": {
                                        "type": "object",
                                        "properties": {
                                          "userId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "tenantId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "userId",
                                          "tenantId",
                                          "roleIds"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "respondedAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "decision": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "approved"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "rejected"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "selected"
                                              },
                                              "optionIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "optionIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "freeform"
                                              },
                                              "text": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "structured"
                                              },
                                              "value": {}
                                            },
                                            "required": [
                                              "type",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "runWaitId",
                                      "requestTaskId",
                                      "responder",
                                      "respondedAt",
                                      "decision"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "finalState": {
                                        "type": "string",
                                        "enum": [
                                          "closed",
                                          "failed",
                                          "abandoned"
                                        ]
                                      },
                                      "manifestArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "visibleOutputArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "visibleOutputArtifacts": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "type": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "workspacePath": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentHash": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "name",
                                            "type",
                                            "contentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "runtimePolicyUsed": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "output": {},
                                      "outputSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "childRunId",
                                      "finalState",
                                      "visibleOutputArtifactIds",
                                      "visibleOutputArtifacts"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "occurredAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "data": {},
                                      "producer": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "occurredAt",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "responderId": {
                                "type": "string"
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "childRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "groupId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "role",
                              "status",
                              "sequenceNumber",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "run",
                        "pendingTasks"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Run_delete",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/chat-snapshot": {
      "get": {
        "operationId": "Run_chatSnapshot",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "beforeSequence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "pendingTasks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "parentTaskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "tool",
                                  "skill",
                                  "human_input",
                                  "child_run",
                                  "external_wait"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "completed",
                                  "failed",
                                  "abandoned",
                                  "skipped",
                                  "cancelled"
                                ]
                              },
                              "sequenceNumber": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "skillName": {
                                "type": "string"
                              },
                              "skillVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "input": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "tool"
                                      },
                                      "toolName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "args": {},
                                      "toolUseId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "toolName",
                                      "args"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "skillHandle": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "context": {}
                                    },
                                    "required": [
                                      "role",
                                      "skillHandle",
                                      "input"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "approval"
                                          },
                                          "proposedActionSummary": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "approvalSubject": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "skill_activation"
                                                  },
                                                  "skillHandle": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillVersionId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "input": {},
                                                      "artifactIds": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "context": {}
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "skillHandle",
                                                  "skillId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "tool_activation"
                                                  },
                                                  "toolName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "connectorId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "args": {}
                                                    },
                                                    "required": [
                                                      "args"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "toolName",
                                                  "connectorId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "proposedActionSummary"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "selection"
                                          },
                                          "options": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "description": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "allowMultiple": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "options"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "freeform"
                                          },
                                          "responseHint": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "structured"
                                          },
                                          "responseSchema": {}
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "responseSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "agentId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "title": {
                                        "type": "string"
                                      },
                                      "runtimeHint": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "expectedOutputSchema": {},
                                      "delegationReason": {
                                        "type": "string"
                                      },
                                      "resumePolicy": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "all"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "any"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "count"
                                              },
                                              "requiredCount": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "requiredCount"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "prompt",
                                      "agentId",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string"
                                      },
                                      "expectedPayloadSchema": {},
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "result": {
                                "oneOf": [
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "completed"
                                          },
                                          "output": {},
                                          "artifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "waiting"
                                          },
                                          "waitId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "waitGroupId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "waitId",
                                          "waitGroupId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "enum": [
                                              "failed",
                                              "skipped",
                                              "abandoned",
                                              "cancelled"
                                            ]
                                          },
                                          "reason": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "reason"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "outcome": {
                                        "type": "string",
                                        "enum": [
                                          "completed",
                                          "failed",
                                          "abandoned",
                                          "cancelled"
                                        ]
                                      },
                                      "output": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "outcome"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "runWaitId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "requestTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responder": {
                                        "type": "object",
                                        "properties": {
                                          "userId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "tenantId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "userId",
                                          "tenantId",
                                          "roleIds"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "respondedAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "decision": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "approved"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "rejected"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "selected"
                                              },
                                              "optionIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "optionIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "freeform"
                                              },
                                              "text": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "structured"
                                              },
                                              "value": {}
                                            },
                                            "required": [
                                              "type",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "runWaitId",
                                      "requestTaskId",
                                      "responder",
                                      "respondedAt",
                                      "decision"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "finalState": {
                                        "type": "string",
                                        "enum": [
                                          "closed",
                                          "failed",
                                          "abandoned"
                                        ]
                                      },
                                      "manifestArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "visibleOutputArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "visibleOutputArtifacts": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "type": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "workspacePath": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentHash": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "name",
                                            "type",
                                            "contentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "runtimePolicyUsed": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "output": {},
                                      "outputSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "childRunId",
                                      "finalState",
                                      "visibleOutputArtifactIds",
                                      "visibleOutputArtifacts"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "occurredAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "data": {},
                                      "producer": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "occurredAt",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "responderId": {
                                "type": "string"
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "childRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "groupId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "role",
                              "status",
                              "sequenceNumber",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant",
                                  "system"
                                ]
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "tool_call",
                                  "tool_result",
                                  "task_result",
                                  "status",
                                  "error"
                                ]
                              },
                              "content": {
                                "type": "string"
                              },
                              "authorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "metadata": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "sequence": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "role",
                              "kind",
                              "sequence",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "participants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "userId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "userName": {
                                "type": "string"
                              },
                              "userEmail": {
                                "type": "string"
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "owner",
                                  "driver",
                                  "reviewer",
                                  "approver",
                                  "watcher",
                                  "collaborator",
                                  "observer"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "userId",
                              "role",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "run",
                        "pendingTasks",
                        "messages",
                        "participants"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/messages": {
      "get": {
        "operationId": "Run_listMessages",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "beforeSequence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant",
                                  "system"
                                ]
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "tool_call",
                                  "tool_result",
                                  "task_result",
                                  "status",
                                  "error"
                                ]
                              },
                              "content": {
                                "type": "string"
                              },
                              "authorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "metadata": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "sequence": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "role",
                              "kind",
                              "sequence",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "messages"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_sendMessage",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1
                  },
                  "clientRequestId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "user",
                                "assistant",
                                "system"
                              ]
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "text",
                                "tool_call",
                                "tool_result",
                                "task_result",
                                "status",
                                "error"
                              ]
                            },
                            "content": {
                              "type": "string"
                            },
                            "authorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "metadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "taskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "kind",
                            "sequence",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/tasks": {
      "get": {
        "operationId": "Run_listTasks",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "running",
                "completed",
                "failed",
                "abandoned",
                "skipped",
                "cancelled"
              ]
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tool",
                "skill",
                "human_input",
                "child_run",
                "external_wait"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "tasks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "parentTaskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "tool",
                                  "skill",
                                  "human_input",
                                  "child_run",
                                  "external_wait"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "running",
                                  "completed",
                                  "failed",
                                  "abandoned",
                                  "skipped",
                                  "cancelled"
                                ]
                              },
                              "sequenceNumber": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "skillName": {
                                "type": "string"
                              },
                              "skillVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "input": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "request": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "tool"
                                      },
                                      "toolName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "args": {},
                                      "toolUseId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "toolName",
                                      "args"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "skillHandle": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "context": {}
                                    },
                                    "required": [
                                      "role",
                                      "skillHandle",
                                      "input"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "approval"
                                          },
                                          "proposedActionSummary": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "approvalSubject": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "skill_activation"
                                                  },
                                                  "skillHandle": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "skillVersionId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "input": {},
                                                      "artifactIds": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "context": {}
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "skillHandle",
                                                  "skillId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "kind": {
                                                    "type": "string",
                                                    "const": "tool_activation"
                                                  },
                                                  "toolName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "connectorId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "toolUseId": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "request": {
                                                    "type": "object",
                                                    "properties": {
                                                      "args": {}
                                                    },
                                                    "required": [
                                                      "args"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "kind",
                                                  "toolName",
                                                  "connectorId",
                                                  "request"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "proposedActionSummary"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "selection"
                                          },
                                          "options": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "label": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "description": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "label"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "allowMultiple": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "options"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "freeform"
                                          },
                                          "responseHint": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "title": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "relatedArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "allowedResponders": {
                                            "type": "object",
                                            "properties": {
                                              "userIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          },
                                          "requestType": {
                                            "type": "string",
                                            "const": "structured"
                                          },
                                          "responseSchema": {}
                                        },
                                        "required": [
                                          "role",
                                          "title",
                                          "prompt",
                                          "relatedArtifactIds",
                                          "allowedResponders",
                                          "timeoutPolicy",
                                          "requestType",
                                          "responseSchema"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "agentId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "input": {},
                                      "title": {
                                        "type": "string"
                                      },
                                      "runtimeHint": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "expectedOutputSchema": {},
                                      "delegationReason": {
                                        "type": "string"
                                      },
                                      "resumePolicy": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "all"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "any"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "count"
                                              },
                                              "requiredCount": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "requiredCount"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "prompt",
                                      "agentId",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "prompt": {
                                        "type": "string"
                                      },
                                      "expectedPayloadSchema": {},
                                      "deadlineAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "timeoutPolicy": {
                                        "type": "string",
                                        "enum": [
                                          "fail_run",
                                          "resume_with_timeout",
                                          "cancel_run"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "timeoutPolicy"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "result": {
                                "oneOf": [
                                  {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "completed"
                                          },
                                          "output": {},
                                          "artifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "const": "waiting"
                                          },
                                          "waitId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "waitGroupId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "waitId",
                                          "waitGroupId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "enum": [
                                              "failed",
                                              "skipped",
                                              "abandoned",
                                              "cancelled"
                                            ]
                                          },
                                          "reason": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome",
                                          "reason"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "skill"
                                      },
                                      "outcome": {
                                        "type": "string",
                                        "enum": [
                                          "completed",
                                          "failed",
                                          "abandoned",
                                          "cancelled"
                                        ]
                                      },
                                      "output": {},
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "outcome"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "human_input"
                                      },
                                      "runWaitId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "requestTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "responder": {
                                        "type": "object",
                                        "properties": {
                                          "userId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "tenantId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "roleIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          }
                                        },
                                        "required": [
                                          "userId",
                                          "tenantId",
                                          "roleIds"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "respondedAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "decision": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "approved"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "rejected"
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "selected"
                                              },
                                              "optionIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "optionIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "freeform"
                                              },
                                              "text": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "type",
                                              "text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "type": {
                                                "type": "string",
                                                "const": "structured"
                                              },
                                              "value": {}
                                            },
                                            "required": [
                                              "type",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "runWaitId",
                                      "requestTaskId",
                                      "responder",
                                      "respondedAt",
                                      "decision"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "child_run"
                                      },
                                      "childRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "finalState": {
                                        "type": "string",
                                        "enum": [
                                          "closed",
                                          "failed",
                                          "abandoned"
                                        ]
                                      },
                                      "manifestArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "visibleOutputArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "visibleOutputArtifacts": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "name": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "type": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "workspacePath": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "contentHash": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "name",
                                            "type",
                                            "contentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "runtimePolicyUsed": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "output": {},
                                      "outputSchema": {}
                                    },
                                    "required": [
                                      "role",
                                      "childRunId",
                                      "finalState",
                                      "visibleOutputArtifactIds",
                                      "visibleOutputArtifacts"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "role": {
                                        "type": "string",
                                        "const": "external_wait"
                                      },
                                      "eventName": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchKey": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "occurredAt": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "data": {},
                                      "producer": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "role",
                                      "eventName",
                                      "matchKey",
                                      "occurredAt",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "responderId": {
                                "type": "string"
                              },
                              "claimedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "claimedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "childRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "groupId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "role",
                              "status",
                              "sequenceNumber",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "tasks"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/comments": {
      "get": {
        "operationId": "Run_listComments",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "comments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runArtifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "authorId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "body": {
                                "type": "string"
                              },
                              "archivedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "archivedByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "authorId",
                              "body",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "comments"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_createComment",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "taskId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runArtifactId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "comment": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "taskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runArtifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "authorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "body": {
                              "type": "string"
                            },
                            "archivedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "archivedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "authorId",
                            "body",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "comment"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/participants": {
      "get": {
        "operationId": "Run_listParticipants",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "participants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "userId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "userName": {
                                "type": "string"
                              },
                              "userEmail": {
                                "type": "string"
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "owner",
                                  "driver",
                                  "reviewer",
                                  "approver",
                                  "watcher",
                                  "collaborator",
                                  "observer"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "userId",
                              "role",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "participants"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_addParticipant",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "userName": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "driver",
                      "reviewer",
                      "approver",
                      "watcher",
                      "collaborator",
                      "observer"
                    ]
                  }
                },
                "required": [
                  "userId",
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "participant": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string"
                            },
                            "userEmail": {
                              "type": "string"
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "owner",
                                "driver",
                                "reviewer",
                                "approver",
                                "watcher",
                                "collaborator",
                                "observer"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "userId",
                            "role",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "participant"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/deliveries": {
      "get": {
        "operationId": "Run_listDeliveries",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deliveries": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "initial_start"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "userMessage": {
                                        "type": "string"
                                      },
                                      "forkedFromRunId": {
                                        "type": "string"
                                      },
                                      "forkedFromTurnId": {
                                        "type": "string"
                                      },
                                      "idempotencyDomain": {
                                        "type": "string"
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "modelRoutingPolicyOverride": {
                                        "type": "object",
                                        "properties": {
                                          "preferredProviderId": {
                                            "type": "string"
                                          },
                                          "credentialId": {
                                            "type": "string"
                                          },
                                          "allowPlatformCredentials": {
                                            "type": "boolean"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "systemPromptOverride": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "userMessage"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "user_message"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "messageId": {
                                        "type": "string"
                                      },
                                      "content": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "messageId",
                                      "content"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "human_response"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "runWaitId": {
                                        "type": "string"
                                      },
                                      "response": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "decision": {
                                                "type": "string",
                                                "enum": [
                                                  "approved",
                                                  "rejected"
                                                ]
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "decision"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "optionIds": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "note": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "optionIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "text": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "value": {}
                                            },
                                            "required": [
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "runWaitId",
                                      "response"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "child_run_result"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "childRunId": {
                                        "type": "string"
                                      },
                                      "childTaskId": {
                                        "type": "string"
                                      },
                                      "finalState": {
                                        "type": "string",
                                        "enum": [
                                          "closed",
                                          "failed",
                                          "abandoned"
                                        ]
                                      },
                                      "manifestArtifactId": {
                                        "type": "string"
                                      },
                                      "visibleOutputArtifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "visibleOutputArtifacts": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "type": "string"
                                            },
                                            "workspacePath": {
                                              "type": "string"
                                            },
                                            "contentHash": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "name",
                                            "type",
                                            "contentHash"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "runtimePolicyUsed": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "keyTaskIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "output": {},
                                      "outputSchema": {}
                                    },
                                    "required": [
                                      "childRunId",
                                      "childTaskId",
                                      "finalState",
                                      "manifestArtifactId",
                                      "visibleOutputArtifactIds",
                                      "visibleOutputArtifacts"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "schedule_fire"
                                  },
                                  "sourcePayload": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "scheduleId": {
                                            "type": "string"
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "const": "latest"
                                          },
                                          "firedAt": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "coalescedCount": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "scheduleId",
                                          "deliveryPolicy",
                                          "firedAt",
                                          "coalescedCount"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "scheduleId": {
                                            "type": "string"
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "const": "all"
                                          },
                                          "firedAt": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          }
                                        },
                                        "required": [
                                          "scheduleId",
                                          "deliveryPolicy",
                                          "firedAt"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "scheduleId": {
                                            "type": "string"
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "const": "count_only"
                                          },
                                          "firstScheduledFor": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "latestScheduledFor": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "missedFireCount": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "scheduleId",
                                          "deliveryPolicy",
                                          "firstScheduledFor",
                                          "latestScheduledFor",
                                          "missedFireCount"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "external_event"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "eventName": {
                                        "type": "string"
                                      },
                                      "matchKey": {
                                        "type": "string"
                                      },
                                      "producer": {
                                        "type": "string"
                                      },
                                      "occurredAt": {
                                        "type": "string"
                                      },
                                      "data": {}
                                    },
                                    "required": [
                                      "eventName",
                                      "producer",
                                      "occurredAt",
                                      "data"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "cancel_run"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "cancel_wait"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "runWaitId": {
                                        "type": "string"
                                      },
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "runWaitId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "manual_resume"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "reason": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "wait_timeout"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "runWaitId": {
                                        "type": "string"
                                      },
                                      "deadlineAt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "runWaitId",
                                      "deadlineAt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "recovery_resume"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {},
                                    "additionalProperties": {}
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceRef": {
                                    "type": "string"
                                  },
                                  "idempotencyKey": {
                                    "type": "string"
                                  },
                                  "transportKind": {
                                    "type": "string",
                                    "enum": [
                                      "route",
                                      "queue",
                                      "workflow",
                                      "alarm",
                                      "internal"
                                    ]
                                  },
                                  "transportMessageId": {
                                    "type": "string"
                                  },
                                  "transport": {},
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "consumed",
                                      "ignored"
                                    ]
                                  },
                                  "attemptCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "lastError": {
                                    "type": "string"
                                  },
                                  "deadLetteredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "ignoredReason": {
                                    "type": "string"
                                  },
                                  "nextRetryAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "consumedByRunTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "receivedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "consumedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "const": "knowledge_event"
                                  },
                                  "sourcePayload": {
                                    "type": "object",
                                    "properties": {
                                      "triggerId": {
                                        "type": "string"
                                      },
                                      "triggerName": {
                                        "type": "string"
                                      },
                                      "eventId": {
                                        "type": "string"
                                      },
                                      "knowledgeGraphId": {
                                        "type": "string"
                                      },
                                      "entityKind": {
                                        "type": "string"
                                      },
                                      "nodeId": {
                                        "type": "string"
                                      },
                                      "artifactVersionId": {
                                        "type": "string"
                                      },
                                      "slug": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "changeType": {
                                        "type": "string",
                                        "enum": [
                                          "created",
                                          "updated",
                                          "deleted"
                                        ]
                                      },
                                      "causationDepth": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "triggerId",
                                      "eventId",
                                      "knowledgeGraphId",
                                      "slug",
                                      "changeType",
                                      "causationDepth"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "idempotencyKey",
                                  "status",
                                  "attemptCount",
                                  "receivedAt",
                                  "sourceKind"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "deliveries"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/knowledge-changes": {
      "get": {
        "operationId": "Run_listKnowledgeChanges",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "knowledgeGraphName": {
                                "type": "string"
                              },
                              "brainDeleted": {
                                "type": "boolean"
                              },
                              "entityKind": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "changeType": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "updated",
                                  "deleted"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "knowledgeGraphId",
                              "knowledgeGraphName",
                              "slug",
                              "changeType",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "changes"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/knowledge-context": {
      "get": {
        "operationId": "Run_knowledgeContext",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "pins": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "knowledgeGraphId": {
                                "type": "string"
                              },
                              "brainName": {
                                "type": "string"
                              },
                              "brainDeleted": {
                                "type": "boolean"
                              },
                              "offset": {
                                "type": "string"
                              },
                              "asOf": {
                                "type": "string"
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "read",
                                  "trigger_event"
                                ]
                              },
                              "changesSince": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "changesSinceCapped": {
                                "type": "boolean"
                              },
                              "previous": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string"
                                  },
                                  "pinnedAt": {
                                    "type": "string"
                                  },
                                  "offset": {
                                    "type": "string"
                                  },
                                  "events": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "knowledgeGraphId": {
                                          "type": "string"
                                        },
                                        "knowledgeGraphName": {
                                          "type": "string"
                                        },
                                        "brainDeleted": {
                                          "type": "boolean"
                                        },
                                        "entityKind": {
                                          "type": "string"
                                        },
                                        "slug": {
                                          "type": "string"
                                        },
                                        "changeType": {
                                          "type": "string",
                                          "enum": [
                                            "created",
                                            "updated",
                                            "deleted"
                                          ]
                                        },
                                        "title": {
                                          "type": "string"
                                        },
                                        "createdAt": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "knowledgeGraphId",
                                        "knowledgeGraphName",
                                        "slug",
                                        "changeType",
                                        "createdAt"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "eventsCapped": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "pinnedAt",
                                  "offset",
                                  "events",
                                  "eventsCapped"
                                ],
                                "additionalProperties": false
                              },
                              "sources": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "artifactId": {
                                      "type": "string"
                                    },
                                    "versions": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactVersionId": {
                                            "type": "string"
                                          },
                                          "nodeId": {
                                            "type": "string"
                                          },
                                          "reads": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "firstReadAt": {
                                            "type": "string"
                                          },
                                          "lastReadAt": {
                                            "type": "string"
                                          },
                                          "sources": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          }
                                        },
                                        "required": [
                                          "reads",
                                          "firstReadAt",
                                          "lastReadAt",
                                          "sources"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "artifactId",
                                    "versions"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "receiptsIncomplete": {
                                "type": "boolean"
                              },
                              "precision": {
                                "type": "string",
                                "enum": [
                                  "valid_time",
                                  "recorded_time"
                                ]
                              }
                            },
                            "required": [
                              "knowledgeGraphId",
                              "brainName",
                              "offset",
                              "asOf",
                              "source",
                              "changesSince",
                              "changesSinceCapped",
                              "sources",
                              "receiptsIncomplete",
                              "precision"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "remediation": {
                          "type": "object",
                          "properties": {
                            "eligible": {
                              "type": "boolean"
                            },
                            "reason": {
                              "type": "string"
                            },
                            "fromRunTurnId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "eligible"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "pins",
                        "remediation"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/children": {
      "get": {
        "operationId": "Run_listChildren",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "children": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "childRun": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "pending"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "active"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "closed"
                                      },
                                      "output": {}
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "failed"
                                      },
                                      "failureReason": {
                                        "type": "string"
                                      },
                                      "failureCategory": {
                                        "type": "string",
                                        "enum": [
                                          "provider_error",
                                          "invariant_violation",
                                          "unhandled_exception",
                                          "dependency_unavailable"
                                        ]
                                      },
                                      "failureDetail": {}
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state",
                                      "failureReason",
                                      "failureCategory"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "summary": {
                                        "type": "string"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent"
                                        ]
                                      },
                                      "actorId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        ]
                                      },
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "spawnedByTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "conversationId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "evalRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "replayOfRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "goalId": {
                                        "type": "string"
                                      },
                                      "input": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {}
                                      },
                                      "messageCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "closePolicy": {
                                        "type": "string",
                                        "enum": [
                                          "explicit",
                                          "auto_on_idle",
                                          "auto_on_parent_delivery"
                                        ]
                                      },
                                      "wakePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "manual": {
                                            "type": "boolean"
                                          },
                                          "schedules": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "cron": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deliveryPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "latest",
                                                    "all",
                                                    "count_only"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "cron",
                                                "deliveryPolicy"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "events": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "eventName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "matchKey": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "eventName"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "manual",
                                          "schedules",
                                          "events"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "resourcePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "behavioral": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          },
                                          "reference": {
                                            "type": "string",
                                            "enum": [
                                              "pin_on_run_start",
                                              "follow_latest_on_turn_start"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "behavioral",
                                          "reference"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "runtimePolicy": {
                                        "type": "object",
                                        "properties": {
                                          "sandboxLifecycle": {
                                            "type": "string",
                                            "enum": [
                                              "ephemeral_per_turn",
                                              "snapshot_to_r2",
                                              "warm_per_run"
                                            ]
                                          },
                                          "executionRuntime": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "workspaceMode": {
                                            "default": "none",
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "persistent"
                                            ]
                                          },
                                          "directToolPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "workspaceWritePrefixes": {
                                                "maxItems": 100,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "destructiveCommands": {
                                                "default": "allow",
                                                "type": "string",
                                                "enum": [
                                                  "allow",
                                                  "deny"
                                                ]
                                              },
                                              "codemode": {
                                                "type": "object",
                                                "properties": {
                                                  "enabled": {
                                                    "default": true,
                                                    "type": "boolean"
                                                  },
                                                  "minEligibleTools": {
                                                    "default": 5,
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 1000
                                                  },
                                                  "timeoutMs": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "enabled",
                                                  "minEligibleTools"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "required": [
                                              "destructiveCommands"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "automationTest": {
                                            "type": "boolean"
                                          },
                                          "automationRun": {
                                            "type": "boolean"
                                          },
                                          "automationBrainAccess": {
                                            "type": "string",
                                            "enum": [
                                              "read_only",
                                              "read_write"
                                            ]
                                          },
                                          "automationKnowledgeGraphId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "sandboxLifecycle",
                                          "executionRuntime",
                                          "workspaceMode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "budgetPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "maxTokensPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerRun": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxTokensPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "maxCostCentsPerTurn": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "tokensUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCentsUsed": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "behaviorSnapshot": {
                                        "type": "object",
                                        "properties": {
                                          "agentPromptVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "pinnedSkills": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "executionMode": {
                                                  "type": "string",
                                                  "enum": [
                                                    "prompt",
                                                    "code"
                                                  ]
                                                },
                                                "allowedTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "body": {
                                                  "type": "string"
                                                },
                                                "bundleRef": {
                                                  "type": "string"
                                                },
                                                "bundleHash": {
                                                  "type": "string"
                                                },
                                                "metadata": {}
                                              },
                                              "required": [
                                                "skillVersionId",
                                                "executionMode",
                                                "metadata"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "skillPolicies": {},
                                          "model": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "provider": {
                                                "type": "string"
                                              },
                                              "params": {},
                                              "temperature": {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 2
                                              },
                                              "reasoning": {
                                                "type": "string",
                                                "enum": [
                                                  "off",
                                                  "low",
                                                  "medium",
                                                  "high",
                                                  "xhigh",
                                                  "max"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "params"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "modelRoutingPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "preferredProviderId": {
                                                "type": "string"
                                              },
                                              "credentialId": {
                                                "type": "string"
                                              },
                                              "allowPlatformCredentials": {
                                                "type": "boolean"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "systemPromptTemplate": {
                                            "type": "string"
                                          },
                                          "systemPromptTemplateHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "toolCatalogHash": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "harness": {
                                            "type": "object",
                                            "properties": {
                                              "version": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "scoringVersion": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "version",
                                              "scoringVersion"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "closePolicy": {
                                            "type": "string",
                                            "enum": [
                                              "explicit",
                                              "auto_on_idle",
                                              "auto_on_parent_delivery"
                                            ]
                                          },
                                          "wakePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "manual": {
                                                "type": "boolean"
                                              },
                                              "schedules": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "cron": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "deliveryPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "latest",
                                                        "all",
                                                        "count_only"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "cron",
                                                    "deliveryPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "events": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "eventName"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "manual",
                                              "schedules",
                                              "events"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "resourcePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "behavioral": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              },
                                              "reference": {
                                                "type": "string",
                                                "enum": [
                                                  "pin_on_run_start",
                                                  "follow_latest_on_turn_start"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "behavioral",
                                              "reference"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "runtimePolicy": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "goalVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "corpusVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "outputSchema": {},
                                          "packId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindings": {
                                            "default": [],
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "requirementKey": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "packBindingId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "targetKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "connector",
                                                    "corpus"
                                                  ]
                                                },
                                                "targetId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "enabledTools": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                },
                                                "policyOverrides": {}
                                              },
                                              "required": [
                                                "requirementKey",
                                                "packBindingId",
                                                "targetKind",
                                                "targetId"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "pinnedSkills",
                                          "skillPolicies",
                                          "model",
                                          "systemPromptTemplate",
                                          "systemPromptTemplateHash",
                                          "toolCatalogHash",
                                          "harness",
                                          "closePolicy",
                                          "wakePolicy",
                                          "resourcePolicy",
                                          "runtimePolicy",
                                          "budgetPolicy",
                                          "packBindings"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "shareToken": {
                                        "type": "string"
                                      },
                                      "shareExpiresAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "artifactInputs": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "artifactId",
                                            "artifactVersionId"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "pinnedVersions": {
                                        "type": "object",
                                        "propertyNames": {
                                          "type": "string"
                                        },
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      },
                                      "waitingOnUserId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceBranchId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "workspaceOwnershipKind": {
                                        "type": "string",
                                        "enum": [
                                          "auto_created",
                                          "user_specified",
                                          "inherited_from_parent"
                                        ]
                                      },
                                      "executionRuntimeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceModeDerived": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "archivedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "deletedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "updatedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "state": {
                                        "type": "string",
                                        "const": "abandoned"
                                      },
                                      "abandonReason": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "tenantId",
                                      "title",
                                      "actorKind",
                                      "actorId",
                                      "messageCount",
                                      "tokensUsed",
                                      "costCentsUsed",
                                      "executionRuntimeDerived",
                                      "workspaceModeDerived",
                                      "createdAt",
                                      "updatedAt",
                                      "state",
                                      "abandonReason"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "parentTask": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "tenantId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "projectId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "role": {
                                    "type": "string",
                                    "enum": [
                                      "tool",
                                      "skill",
                                      "human_input",
                                      "child_run",
                                      "external_wait"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "running",
                                      "completed",
                                      "failed",
                                      "abandoned",
                                      "skipped",
                                      "cancelled"
                                    ]
                                  },
                                  "sequenceNumber": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "input": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {}
                                  },
                                  "request": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "tool"
                                          },
                                          "toolName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "args": {},
                                          "toolUseId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "toolName",
                                          "args"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "skill"
                                          },
                                          "skillHandle": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "input": {},
                                          "artifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "context": {}
                                        },
                                        "required": [
                                          "role",
                                          "skillHandle",
                                          "input"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "human_input"
                                              },
                                              "title": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "prompt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "relatedArtifactIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "allowedResponders": {
                                                "type": "object",
                                                "properties": {
                                                  "userIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "roleIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "deadlineAt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "timeoutPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "fail_run",
                                                  "resume_with_timeout",
                                                  "cancel_run"
                                                ]
                                              },
                                              "requestType": {
                                                "type": "string",
                                                "const": "approval"
                                              },
                                              "proposedActionSummary": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "approvalSubject": {
                                                "oneOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "skill_activation"
                                                      },
                                                      "skillHandle": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "skillId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "skillVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "toolUseId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "request": {
                                                        "type": "object",
                                                        "properties": {
                                                          "input": {},
                                                          "artifactIds": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "context": {}
                                                        },
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "required": [
                                                      "kind",
                                                      "skillHandle",
                                                      "skillId",
                                                      "request"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "tool_activation"
                                                      },
                                                      "toolName": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "connectorId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "toolUseId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "request": {
                                                        "type": "object",
                                                        "properties": {
                                                          "args": {}
                                                        },
                                                        "required": [
                                                          "args"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "required": [
                                                      "kind",
                                                      "toolName",
                                                      "connectorId",
                                                      "request"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "title",
                                              "prompt",
                                              "relatedArtifactIds",
                                              "allowedResponders",
                                              "timeoutPolicy",
                                              "requestType",
                                              "proposedActionSummary"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "human_input"
                                              },
                                              "title": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "prompt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "relatedArtifactIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "allowedResponders": {
                                                "type": "object",
                                                "properties": {
                                                  "userIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "roleIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "deadlineAt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "timeoutPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "fail_run",
                                                  "resume_with_timeout",
                                                  "cancel_run"
                                                ]
                                              },
                                              "requestType": {
                                                "type": "string",
                                                "const": "selection"
                                              },
                                              "options": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "label": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "description": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "label"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "allowMultiple": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "title",
                                              "prompt",
                                              "relatedArtifactIds",
                                              "allowedResponders",
                                              "timeoutPolicy",
                                              "requestType",
                                              "options"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "human_input"
                                              },
                                              "title": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "prompt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "relatedArtifactIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "allowedResponders": {
                                                "type": "object",
                                                "properties": {
                                                  "userIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "roleIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "deadlineAt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "timeoutPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "fail_run",
                                                  "resume_with_timeout",
                                                  "cancel_run"
                                                ]
                                              },
                                              "requestType": {
                                                "type": "string",
                                                "const": "freeform"
                                              },
                                              "responseHint": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "title",
                                              "prompt",
                                              "relatedArtifactIds",
                                              "allowedResponders",
                                              "timeoutPolicy",
                                              "requestType"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "human_input"
                                              },
                                              "title": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "prompt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "relatedArtifactIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "allowedResponders": {
                                                "type": "object",
                                                "properties": {
                                                  "userIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "roleIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "deadlineAt": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "timeoutPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "fail_run",
                                                  "resume_with_timeout",
                                                  "cancel_run"
                                                ]
                                              },
                                              "requestType": {
                                                "type": "string",
                                                "const": "structured"
                                              },
                                              "responseSchema": {}
                                            },
                                            "required": [
                                              "role",
                                              "title",
                                              "prompt",
                                              "relatedArtifactIds",
                                              "allowedResponders",
                                              "timeoutPolicy",
                                              "requestType",
                                              "responseSchema"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "child_run"
                                          },
                                          "childRunId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "agentId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "input": {},
                                          "title": {
                                            "type": "string"
                                          },
                                          "runtimeHint": {
                                            "type": "string",
                                            "enum": [
                                              "none",
                                              "fast_virtual",
                                              "dynamic_worker",
                                              "required_full_os"
                                            ]
                                          },
                                          "modelId": {
                                            "type": "string"
                                          },
                                          "budgetPolicy": {
                                            "type": "object",
                                            "properties": {
                                              "maxTokensPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerRun": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxTokensPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "maxCostCentsPerTurn": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "artifactInputs": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "expectedOutputSchema": {},
                                          "delegationReason": {
                                            "type": "string"
                                          },
                                          "resumePolicy": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "all"
                                                  }
                                                },
                                                "required": [
                                                  "mode"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "any"
                                                  }
                                                },
                                                "required": [
                                                  "mode"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "count"
                                                  },
                                                  "requiredCount": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "mode",
                                                  "requiredCount"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          },
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "prompt",
                                          "agentId",
                                          "timeoutPolicy"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "external_wait"
                                          },
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "prompt": {
                                            "type": "string"
                                          },
                                          "expectedPayloadSchema": {},
                                          "deadlineAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "timeoutPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "fail_run",
                                              "resume_with_timeout",
                                              "cancel_run"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "eventName",
                                          "matchKey",
                                          "timeoutPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "result": {
                                    "oneOf": [
                                      {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "tool"
                                              },
                                              "outcome": {
                                                "type": "string",
                                                "const": "completed"
                                              },
                                              "output": {},
                                              "artifactIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "outcome"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "tool"
                                              },
                                              "outcome": {
                                                "type": "string",
                                                "const": "waiting"
                                              },
                                              "waitId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "waitGroupId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "outcome",
                                              "waitId",
                                              "waitGroupId"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "role": {
                                                "type": "string",
                                                "const": "tool"
                                              },
                                              "outcome": {
                                                "type": "string",
                                                "enum": [
                                                  "failed",
                                                  "skipped",
                                                  "abandoned",
                                                  "cancelled"
                                                ]
                                              },
                                              "reason": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "role",
                                              "outcome",
                                              "reason"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "skill"
                                          },
                                          "outcome": {
                                            "type": "string",
                                            "enum": [
                                              "completed",
                                              "failed",
                                              "abandoned",
                                              "cancelled"
                                            ]
                                          },
                                          "output": {},
                                          "artifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "reason": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "outcome"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "human_input"
                                          },
                                          "runWaitId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "requestTaskId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "responder": {
                                            "type": "object",
                                            "properties": {
                                              "userId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "tenantId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "roleIds": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              }
                                            },
                                            "required": [
                                              "userId",
                                              "tenantId",
                                              "roleIds"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "respondedAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "decision": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "approved"
                                                  },
                                                  "note": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "type"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "rejected"
                                                  },
                                                  "note": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "type"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "selected"
                                                  },
                                                  "optionIds": {
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "note": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "optionIds"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "freeform"
                                                  },
                                                  "text": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "required": [
                                                  "type",
                                                  "text"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "type": {
                                                    "type": "string",
                                                    "const": "structured"
                                                  },
                                                  "value": {}
                                                },
                                                "required": [
                                                  "type",
                                                  "value"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "runWaitId",
                                          "requestTaskId",
                                          "responder",
                                          "respondedAt",
                                          "decision"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "child_run"
                                          },
                                          "childRunId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "finalState": {
                                            "type": "string",
                                            "enum": [
                                              "closed",
                                              "failed",
                                              "abandoned"
                                            ]
                                          },
                                          "manifestArtifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "visibleOutputArtifactIds": {
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "visibleOutputArtifacts": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "artifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "name": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "type": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspacePath": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "contentHash": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "required": [
                                                "artifactId",
                                                "name",
                                                "type",
                                                "contentHash"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "summary": {
                                            "type": "string"
                                          },
                                          "costCentsUsed": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "tokensUsed": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          "runtimePolicyUsed": {
                                            "type": "object",
                                            "properties": {
                                              "sandboxLifecycle": {
                                                "type": "string",
                                                "enum": [
                                                  "ephemeral_per_turn",
                                                  "snapshot_to_r2",
                                                  "warm_per_run"
                                                ]
                                              },
                                              "executionRuntime": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "fast_virtual",
                                                  "dynamic_worker",
                                                  "required_full_os"
                                                ]
                                              },
                                              "workspaceMode": {
                                                "default": "none",
                                                "type": "string",
                                                "enum": [
                                                  "none",
                                                  "persistent"
                                                ]
                                              },
                                              "directToolPolicy": {
                                                "type": "object",
                                                "properties": {
                                                  "workspaceWritePrefixes": {
                                                    "maxItems": 100,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "destructiveCommands": {
                                                    "default": "allow",
                                                    "type": "string",
                                                    "enum": [
                                                      "allow",
                                                      "deny"
                                                    ]
                                                  },
                                                  "codemode": {
                                                    "type": "object",
                                                    "properties": {
                                                      "enabled": {
                                                        "default": true,
                                                        "type": "boolean"
                                                      },
                                                      "minEligibleTools": {
                                                        "default": 5,
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 1000
                                                      },
                                                      "timeoutMs": {
                                                        "type": "integer",
                                                        "exclusiveMinimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "required": [
                                                      "enabled",
                                                      "minEligibleTools"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "destructiveCommands"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "automationTest": {
                                                "type": "boolean"
                                              },
                                              "automationRun": {
                                                "type": "boolean"
                                              },
                                              "automationBrainAccess": {
                                                "type": "string",
                                                "enum": [
                                                  "read_only",
                                                  "read_write"
                                                ]
                                              },
                                              "automationKnowledgeGraphId": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "sandboxLifecycle",
                                              "executionRuntime",
                                              "workspaceMode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "output": {},
                                          "outputSchema": {}
                                        },
                                        "required": [
                                          "role",
                                          "childRunId",
                                          "finalState",
                                          "visibleOutputArtifactIds",
                                          "visibleOutputArtifacts"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string",
                                            "const": "external_wait"
                                          },
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "occurredAt": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "data": {},
                                          "producer": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "role",
                                          "eventName",
                                          "matchKey",
                                          "occurredAt",
                                          "data"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "responderId": {
                                    "type": "string"
                                  },
                                  "claimedByUserId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "claimedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "childRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "groupId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "expiresAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "updatedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "runId",
                                  "tenantId",
                                  "role",
                                  "status",
                                  "sequenceNumber",
                                  "createdAt",
                                  "updatedAt"
                                ],
                                "additionalProperties": false
                              },
                              "request": {
                                "type": "object",
                                "properties": {
                                  "role": {
                                    "type": "string",
                                    "const": "child_run"
                                  },
                                  "childRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "input": {},
                                  "title": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "budgetPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "maxTokensPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerRun": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxTokensPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "maxCostCentsPerTurn": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "artifactInputs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "expectedOutputSchema": {},
                                  "delegationReason": {
                                    "type": "string"
                                  },
                                  "resumePolicy": {
                                    "oneOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "const": "all"
                                          }
                                        },
                                        "required": [
                                          "mode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "const": "any"
                                          }
                                        },
                                        "required": [
                                          "mode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "mode": {
                                            "type": "string",
                                            "const": "count"
                                          },
                                          "requiredCount": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "mode",
                                          "requiredCount"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "deadlineAt": {
                                    "type": "string"
                                  },
                                  "timeoutPolicy": {
                                    "type": "string",
                                    "enum": [
                                      "fail_run",
                                      "resume_with_timeout",
                                      "cancel_run"
                                    ]
                                  }
                                },
                                "required": [
                                  "role",
                                  "prompt",
                                  "agentId",
                                  "timeoutPolicy"
                                ],
                                "additionalProperties": false
                              },
                              "result": {
                                "type": "object",
                                "properties": {
                                  "role": {
                                    "type": "string",
                                    "const": "child_run"
                                  },
                                  "childRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "finalState": {
                                    "type": "string",
                                    "enum": [
                                      "closed",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "manifestArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "visibleOutputArtifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "visibleOutputArtifacts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "workspacePath": {
                                          "type": "string"
                                        },
                                        "contentHash": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "artifactId",
                                        "name",
                                        "type",
                                        "contentHash"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "costCentsUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "tokensUsed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "runtimePolicyUsed": {
                                    "type": "object",
                                    "properties": {
                                      "sandboxLifecycle": {
                                        "type": "string",
                                        "enum": [
                                          "ephemeral_per_turn",
                                          "snapshot_to_r2",
                                          "warm_per_run"
                                        ]
                                      },
                                      "executionRuntime": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      },
                                      "workspaceMode": {
                                        "default": "none",
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "persistent"
                                        ]
                                      },
                                      "directToolPolicy": {
                                        "type": "object",
                                        "properties": {
                                          "workspaceWritePrefixes": {
                                            "maxItems": 100,
                                            "type": "array",
                                            "items": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "destructiveCommands": {
                                            "default": "allow",
                                            "type": "string",
                                            "enum": [
                                              "allow",
                                              "deny"
                                            ]
                                          },
                                          "codemode": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "default": true,
                                                "type": "boolean"
                                              },
                                              "minEligibleTools": {
                                                "default": 5,
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 1000
                                              },
                                              "timeoutMs": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "minEligibleTools"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "destructiveCommands"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "automationTest": {
                                        "type": "boolean"
                                      },
                                      "automationRun": {
                                        "type": "boolean"
                                      },
                                      "automationBrainAccess": {
                                        "type": "string",
                                        "enum": [
                                          "read_only",
                                          "read_write"
                                        ]
                                      },
                                      "automationKnowledgeGraphId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "sandboxLifecycle",
                                      "executionRuntime",
                                      "workspaceMode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "output": {},
                                  "outputSchema": {}
                                },
                                "required": [
                                  "role",
                                  "childRunId",
                                  "finalState",
                                  "visibleOutputArtifactIds",
                                  "visibleOutputArtifacts"
                                ],
                                "additionalProperties": false
                              },
                              "agent": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "modelId": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              "isPendingCompletion": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "childRun",
                              "isPendingCompletion"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "children"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_createChild",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "delegationReason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "runtimeHint": {
                    "type": "string",
                    "enum": [
                      "none",
                      "fast_virtual",
                      "dynamic_worker",
                      "required_full_os"
                    ]
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "budgetPolicy": {
                    "type": "object",
                    "properties": {
                      "maxTokensPerRun": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxCostCentsPerRun": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxTokensPerTurn": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxCostCentsPerTurn": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  },
                  "artifactInputs": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "expectedOutputSchema": {},
                  "input": {},
                  "resumePolicy": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "all"
                          }
                        },
                        "required": [
                          "mode"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "any"
                          }
                        },
                        "required": [
                          "mode"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "count"
                          },
                          "requiredCount": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "mode",
                          "requiredCount"
                        ]
                      }
                    ]
                  },
                  "deadlineAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "timeoutPolicy": {
                    "default": "resume_with_timeout",
                    "type": "string",
                    "enum": [
                      "fail_run",
                      "resume_with_timeout",
                      "cancel_run"
                    ]
                  }
                },
                "required": [
                  "agentId",
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "childRun": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "pending"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "active"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "closed"
                                },
                                "output": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "failed"
                                },
                                "failureReason": {
                                  "type": "string"
                                },
                                "failureCategory": {
                                  "type": "string",
                                  "enum": [
                                    "provider_error",
                                    "invariant_violation",
                                    "unhandled_exception",
                                    "dependency_unavailable"
                                  ]
                                },
                                "failureDetail": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "failureReason",
                                "failureCategory"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "abandoned"
                                },
                                "abandonReason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "abandonReason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "task": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentTaskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "tool",
                                "skill",
                                "human_input",
                                "child_run",
                                "external_wait"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed",
                                "abandoned",
                                "skipped",
                                "cancelled"
                              ]
                            },
                            "sequenceNumber": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skillName": {
                              "type": "string"
                            },
                            "skillVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "request": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "tool"
                                    },
                                    "toolName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "args": {},
                                    "toolUseId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "toolName",
                                    "args"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "skillHandle": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "context": {}
                                  },
                                  "required": [
                                    "role",
                                    "skillHandle",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "approval"
                                        },
                                        "proposedActionSummary": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "approvalSubject": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "skill_activation"
                                                },
                                                "skillHandle": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "skillHandle",
                                                "skillId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "tool_activation"
                                                },
                                                "toolName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "connectorId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "args": {}
                                                  },
                                                  "required": [
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "toolName",
                                                "connectorId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "proposedActionSummary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "selection"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "description": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "allowMultiple": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "options"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "freeform"
                                        },
                                        "responseHint": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "structured"
                                        },
                                        "responseSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "responseSchema"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "title": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "expectedOutputSchema": {},
                                    "delegationReason": {
                                      "type": "string"
                                    },
                                    "resumePolicy": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "all"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "any"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "count"
                                            },
                                            "requiredCount": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "requiredCount"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "prompt",
                                    "agentId",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string"
                                    },
                                    "expectedPayloadSchema": {},
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "result": {
                              "oneOf": [
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "completed"
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "waiting"
                                        },
                                        "waitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "waitGroupId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "waitId",
                                        "waitGroupId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "failed",
                                            "skipped",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "enum": [
                                        "completed",
                                        "failed",
                                        "abandoned",
                                        "cancelled"
                                      ]
                                    },
                                    "output": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "outcome"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "human_input"
                                    },
                                    "runWaitId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "requestTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responder": {
                                      "type": "object",
                                      "properties": {
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "tenantId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "roleIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "userId",
                                        "tenantId",
                                        "roleIds"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "respondedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decision": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "approved"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "rejected"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "selected"
                                            },
                                            "optionIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "text": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "value": {}
                                          },
                                          "required": [
                                            "type",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runWaitId",
                                    "requestTaskId",
                                    "responder",
                                    "respondedAt",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "type": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "workspacePath": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "role",
                                    "childRunId",
                                    "finalState",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "occurredAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "data": {},
                                    "producer": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "responderId": {
                              "type": "string"
                            },
                            "claimedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "claimedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "childRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "groupId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "status",
                            "sequenceNumber",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "childRun",
                        "task"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/artifacts": {
      "get": {
        "operationId": "Run_listArtifacts",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "artifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "operationId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "artifactVersionId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "json",
                                  "image",
                                  "file_reference",
                                  "hitl_decision",
                                  "manifest",
                                  "log_chunk"
                                ]
                              },
                              "visibility": {
                                "type": "string",
                                "enum": [
                                  "turn_input",
                                  "task_output",
                                  "run_local_state"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              },
                              "contentHash": {
                                "type": "string",
                                "minLength": 1
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "workspacePath": {
                                "type": "string"
                              },
                              "deleted": {
                                "type": "boolean"
                              },
                              "supersedesRunArtifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "type",
                              "visibility",
                              "name",
                              "content",
                              "mimeType",
                              "deleted",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "artifacts"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/previews": {
      "get": {
        "operationId": "Run_listPreviews",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "previews": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runArtifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sandboxId": {
                                "type": "string"
                              },
                              "previewType": {
                                "type": "string",
                                "enum": [
                                  "markdown",
                                  "html",
                                  "json",
                                  "csv",
                                  "image",
                                  "logs",
                                  "live_app"
                                ]
                              },
                              "port": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "urlPath": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "revoked",
                                  "expired"
                                ]
                              },
                              "tokenHash": {
                                "type": "string"
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "revokedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdByActorKind": {
                                "type": "string",
                                "enum": [
                                  "human",
                                  "agent",
                                  "system"
                                ]
                              },
                              "createdByActorId": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "label": {
                                "type": "string"
                              },
                              "openPath": {
                                "type": "string"
                              },
                              "artifactName": {
                                "type": "string"
                              },
                              "artifactMimeType": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "previewType",
                              "status",
                              "tokenHash",
                              "expiresAt",
                              "createdByActorKind",
                              "createdByActorId",
                              "createdAt",
                              "label",
                              "openPath"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "artifacts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runArtifactId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "previewType": {
                                "type": "string",
                                "enum": [
                                  "markdown",
                                  "html",
                                  "json",
                                  "csv",
                                  "image",
                                  "logs",
                                  "live_app"
                                ]
                              },
                              "visibility": {
                                "type": "string",
                                "enum": [
                                  "turn_input",
                                  "task_output",
                                  "run_local_state"
                                ]
                              },
                              "workspacePath": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "runArtifactId",
                              "name",
                              "mimeType",
                              "previewType",
                              "visibility",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "liveSupport": {
                          "type": "object",
                          "properties": {
                            "available": {
                              "type": "boolean"
                            },
                            "commonPorts": {
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "available",
                            "commonPorts"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "previews",
                        "artifacts",
                        "liveSupport"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_createPreview",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "artifact"
                      },
                      "runArtifactId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "kind",
                      "runArtifactId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "live_app"
                      },
                      "port": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 65535
                      },
                      "urlPath": {
                        "type": "string",
                        "maxLength": 512
                      }
                    },
                    "required": [
                      "kind",
                      "port"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "preview": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "taskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runArtifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sandboxId": {
                              "type": "string"
                            },
                            "previewType": {
                              "type": "string",
                              "enum": [
                                "markdown",
                                "html",
                                "json",
                                "csv",
                                "image",
                                "logs",
                                "live_app"
                              ]
                            },
                            "port": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "urlPath": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "revoked",
                                "expired"
                              ]
                            },
                            "tokenHash": {
                              "type": "string"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "revokedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdByActorKind": {
                              "type": "string",
                              "enum": [
                                "human",
                                "agent",
                                "system"
                              ]
                            },
                            "createdByActorId": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "label": {
                              "type": "string"
                            },
                            "openPath": {
                              "type": "string"
                            },
                            "artifactName": {
                              "type": "string"
                            },
                            "artifactMimeType": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "previewType",
                            "status",
                            "tokenHash",
                            "expiresAt",
                            "createdByActorKind",
                            "createdByActorId",
                            "createdAt",
                            "label",
                            "openPath"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "preview"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/streaming-status": {
      "get": {
        "operationId": "Run_streamingStatus",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "runId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "active",
                            "closed",
                            "failed",
                            "abandoned"
                          ]
                        },
                        "isStreaming": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "runId",
                        "state",
                        "isStreaming"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/delegation-graph": {
      "get": {
        "operationId": "Run_delegationGraph",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "graph": {
                          "type": "object",
                          "properties": {
                            "rootRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "depth": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "active",
                                      "closed",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent"
                                    ]
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "summary": {
                                    "type": "string"
                                  },
                                  "agent": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "modelId": {
                                        "type": "string"
                                      },
                                      "runtimeHint": {
                                        "type": "string",
                                        "enum": [
                                          "none",
                                          "fast_virtual",
                                          "dynamic_worker",
                                          "required_full_os"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "requestTitle": {
                                    "type": "string"
                                  },
                                  "delegationReason": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "modelId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "depth",
                                  "title",
                                  "state",
                                  "actorKind",
                                  "actorId",
                                  "createdAt"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "parentRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "parentTaskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "childRunId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "pending",
                                      "active",
                                      "closed",
                                      "failed",
                                      "abandoned"
                                    ]
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "parentRunId",
                                  "childRunId",
                                  "status",
                                  "createdAt",
                                  "label"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "rootRunId",
                            "nodes",
                            "edges"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "graph"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/events": {
      "get": {
        "operationId": "Run_listEvents",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "delivery_received",
                "delivery_consumed",
                "wait_opened",
                "wait_resolved",
                "wait_timed_out",
                "task_claimed",
                "task_released",
                "comment_created",
                "comment_archived",
                "participant_joined",
                "participant_left",
                "role_changed",
                "handoff",
                "child_run_spawned",
                "child_run_completed",
                "preview_created",
                "preview_revoked",
                "memory_proposed",
                "memory_committed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sequence": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "eventType": {
                                "type": "string",
                                "enum": [
                                  "delivery_received",
                                  "delivery_consumed",
                                  "wait_opened",
                                  "wait_resolved",
                                  "wait_timed_out",
                                  "task_claimed",
                                  "task_released",
                                  "comment_created",
                                  "comment_archived",
                                  "participant_joined",
                                  "participant_left",
                                  "role_changed",
                                  "handoff",
                                  "child_run_spawned",
                                  "child_run_completed",
                                  "preview_created",
                                  "preview_revoked",
                                  "memory_proposed",
                                  "memory_committed"
                                ]
                              },
                              "actorKind": {
                                "type": "string",
                                "enum": [
                                  "human",
                                  "agent",
                                  "system"
                                ]
                              },
                              "actorId": {
                                "type": "string"
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sourceTable": {
                                "type": "string"
                              },
                              "sourceId": {
                                "type": "string"
                              },
                              "payload": {},
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "runId",
                              "tenantId",
                              "sequence",
                              "eventType",
                              "actorKind",
                              "actorId",
                              "payload",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "events"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Run_externalEvent",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "matchKey": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "producer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "occurredAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "data": {}
                },
                "required": [
                  "eventName",
                  "producer",
                  "occurredAt",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/timeline": {
      "get": {
        "operationId": "Run_timeline",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "workflow",
                "collaboration",
                "delegation"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "timeline": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sequence": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "eventType": {
                                "type": "string",
                                "enum": [
                                  "delivery_received",
                                  "delivery_consumed",
                                  "wait_opened",
                                  "wait_resolved",
                                  "wait_timed_out",
                                  "task_claimed",
                                  "task_released",
                                  "comment_created",
                                  "comment_archived",
                                  "participant_joined",
                                  "participant_left",
                                  "role_changed",
                                  "handoff",
                                  "child_run_spawned",
                                  "child_run_completed",
                                  "preview_created",
                                  "preview_revoked",
                                  "memory_proposed",
                                  "memory_committed"
                                ]
                              },
                              "category": {
                                "type": "string",
                                "enum": [
                                  "workflow",
                                  "collaboration",
                                  "delegation"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "detail": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "actorKind": {
                                "type": "string",
                                "enum": [
                                  "human",
                                  "agent",
                                  "system"
                                ]
                              },
                              "actorId": {
                                "type": "string"
                              },
                              "runTurnId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "turnNumber": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "taskId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "payload": {}
                            },
                            "required": [
                              "sequence",
                              "eventType",
                              "category",
                              "title",
                              "detail",
                              "createdAt",
                              "actorKind",
                              "actorId",
                              "payload"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "timeline"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/timeline": {
      "get": {
        "operationId": "Run_inspectorTimeline",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "workflow",
                "collaboration",
                "delegation"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "summary": {
                              "type": "object",
                              "properties": {
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "currentState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "active",
                                    "closed",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "totalEvents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "totalTurns": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "totalTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "totalOperations": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "totalArtifacts": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "firstEventAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "lastEventAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "waitingOnUserId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "runId",
                                "currentState",
                                "totalEvents",
                                "totalTurns",
                                "totalTasks",
                                "totalOperations",
                                "totalArtifacts"
                              ],
                              "additionalProperties": false
                            },
                            "turns": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "turnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "turnNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "triggerKind": {
                                    "type": "string",
                                    "enum": [
                                      "initial_start",
                                      "user_message",
                                      "human_response",
                                      "child_run_result",
                                      "schedule_fire",
                                      "external_event",
                                      "cancel_run",
                                      "cancel_wait",
                                      "manual_resume",
                                      "wait_timeout",
                                      "recovery_resume",
                                      "knowledge_event"
                                    ]
                                  },
                                  "triggerRef": {
                                    "type": "string"
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "completed",
                                      "failed",
                                      "cancelled"
                                    ]
                                  },
                                  "completionKind": {
                                    "type": "string",
                                    "enum": [
                                      "yielded_idle",
                                      "entered_waiting",
                                      "closed_run",
                                      "harness_only_advance"
                                    ]
                                  },
                                  "startedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "completedAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "taskIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "operationIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "artifactIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "causal": {
                                    "type": "object",
                                    "properties": {
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchedRunWaitGroupId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchedRunWaitId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "turnId",
                                  "turnNumber",
                                  "triggerKind",
                                  "status",
                                  "startedAt",
                                  "taskIds",
                                  "operationIds",
                                  "artifactIds",
                                  "causal"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "timeline": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sequence": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "eventType": {
                                    "type": "string",
                                    "enum": [
                                      "delivery_received",
                                      "delivery_consumed",
                                      "wait_opened",
                                      "wait_resolved",
                                      "wait_timed_out",
                                      "task_claimed",
                                      "task_released",
                                      "comment_created",
                                      "comment_archived",
                                      "participant_joined",
                                      "participant_left",
                                      "role_changed",
                                      "handoff",
                                      "child_run_spawned",
                                      "child_run_completed",
                                      "preview_created",
                                      "preview_revoked",
                                      "memory_proposed",
                                      "memory_committed"
                                    ]
                                  },
                                  "category": {
                                    "type": "string",
                                    "enum": [
                                      "workflow",
                                      "collaboration",
                                      "delegation"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "actorKind": {
                                    "type": "string",
                                    "enum": [
                                      "human",
                                      "agent",
                                      "system"
                                    ]
                                  },
                                  "actorId": {
                                    "type": "string"
                                  },
                                  "runTurnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "turnNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "taskId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "payload": {},
                                  "triggerKind": {
                                    "type": "string",
                                    "enum": [
                                      "initial_start",
                                      "user_message",
                                      "human_response",
                                      "child_run_result",
                                      "schedule_fire",
                                      "external_event",
                                      "cancel_run",
                                      "cancel_wait",
                                      "manual_resume",
                                      "wait_timeout",
                                      "recovery_resume",
                                      "knowledge_event"
                                    ]
                                  },
                                  "triggerRef": {
                                    "type": "string"
                                  },
                                  "triggerDeliveryId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "inputArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "turnStatus": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "completed",
                                      "failed",
                                      "cancelled"
                                    ]
                                  },
                                  "completionKind": {
                                    "type": "string",
                                    "enum": [
                                      "yielded_idle",
                                      "entered_waiting",
                                      "closed_run",
                                      "harness_only_advance"
                                    ]
                                  },
                                  "causal": {
                                    "type": "object",
                                    "properties": {
                                      "parentRunId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "parentTaskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchedRunWaitGroupId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "matchedRunWaitId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sequence",
                                  "eventType",
                                  "category",
                                  "title",
                                  "detail",
                                  "createdAt",
                                  "actorKind",
                                  "actorId",
                                  "payload",
                                  "causal"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "summary",
                            "turns",
                            "timeline"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector": {
      "get": {
        "operationId": "Run_inspectorAll",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "timeline": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "object",
                                  "properties": {
                                    "runId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "currentState": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "active",
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "totalEvents": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "totalTurns": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "totalTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "totalOperations": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "totalArtifacts": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "firstEventAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "lastEventAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "waitingOnUserId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runId",
                                    "currentState",
                                    "totalEvents",
                                    "totalTurns",
                                    "totalTasks",
                                    "totalOperations",
                                    "totalArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                "turns": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "turnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "turnNumber": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "triggerKind": {
                                        "type": "string",
                                        "enum": [
                                          "initial_start",
                                          "user_message",
                                          "human_response",
                                          "child_run_result",
                                          "schedule_fire",
                                          "external_event",
                                          "cancel_run",
                                          "cancel_wait",
                                          "manual_resume",
                                          "wait_timeout",
                                          "recovery_resume",
                                          "knowledge_event"
                                        ]
                                      },
                                      "triggerRef": {
                                        "type": "string"
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "inputArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "active",
                                          "completed",
                                          "failed",
                                          "cancelled"
                                        ]
                                      },
                                      "completionKind": {
                                        "type": "string",
                                        "enum": [
                                          "yielded_idle",
                                          "entered_waiting",
                                          "closed_run",
                                          "harness_only_advance"
                                        ]
                                      },
                                      "startedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "completedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "taskIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "operationIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "artifactIds": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "causal": {
                                        "type": "object",
                                        "properties": {
                                          "parentRunId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "parentTurnId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "parentTaskId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchedRunWaitGroupId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchedRunWaitId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "turnId",
                                      "turnNumber",
                                      "triggerKind",
                                      "status",
                                      "startedAt",
                                      "taskIds",
                                      "operationIds",
                                      "artifactIds",
                                      "causal"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "timeline": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "sequence": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "eventType": {
                                        "type": "string",
                                        "enum": [
                                          "delivery_received",
                                          "delivery_consumed",
                                          "wait_opened",
                                          "wait_resolved",
                                          "wait_timed_out",
                                          "task_claimed",
                                          "task_released",
                                          "comment_created",
                                          "comment_archived",
                                          "participant_joined",
                                          "participant_left",
                                          "role_changed",
                                          "handoff",
                                          "child_run_spawned",
                                          "child_run_completed",
                                          "preview_created",
                                          "preview_revoked",
                                          "memory_proposed",
                                          "memory_committed"
                                        ]
                                      },
                                      "category": {
                                        "type": "string",
                                        "enum": [
                                          "workflow",
                                          "collaboration",
                                          "delegation"
                                        ]
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "detail": {
                                        "type": "string"
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "actorKind": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "agent",
                                          "system"
                                        ]
                                      },
                                      "actorId": {
                                        "type": "string"
                                      },
                                      "runTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "turnNumber": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "taskId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "payload": {},
                                      "triggerKind": {
                                        "type": "string",
                                        "enum": [
                                          "initial_start",
                                          "user_message",
                                          "human_response",
                                          "child_run_result",
                                          "schedule_fire",
                                          "external_event",
                                          "cancel_run",
                                          "cancel_wait",
                                          "manual_resume",
                                          "wait_timeout",
                                          "recovery_resume",
                                          "knowledge_event"
                                        ]
                                      },
                                      "triggerRef": {
                                        "type": "string"
                                      },
                                      "triggerDeliveryId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "inputArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "turnStatus": {
                                        "type": "string",
                                        "enum": [
                                          "active",
                                          "completed",
                                          "failed",
                                          "cancelled"
                                        ]
                                      },
                                      "completionKind": {
                                        "type": "string",
                                        "enum": [
                                          "yielded_idle",
                                          "entered_waiting",
                                          "closed_run",
                                          "harness_only_advance"
                                        ]
                                      },
                                      "causal": {
                                        "type": "object",
                                        "properties": {
                                          "parentRunId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "parentTurnId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "parentTaskId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchedRunWaitGroupId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchedRunWaitId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "sequence",
                                      "eventType",
                                      "category",
                                      "title",
                                      "detail",
                                      "createdAt",
                                      "actorKind",
                                      "actorId",
                                      "payload",
                                      "causal"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "summary",
                                "turns",
                                "timeline"
                              ],
                              "additionalProperties": false
                            },
                            "tasks": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "object",
                                  "properties": {
                                    "totalTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "rootTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "pendingTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runningTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "completedTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "failedTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "claimedTasks": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "totalTasks",
                                    "rootTasks",
                                    "pendingTasks",
                                    "runningTasks",
                                    "completedTasks",
                                    "failedTasks",
                                    "claimedTasks"
                                  ],
                                  "additionalProperties": false
                                },
                                "roots": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/$defs/__schema0"
                                  }
                                }
                              },
                              "required": [
                                "summary",
                                "roots"
                              ],
                              "additionalProperties": false
                            },
                            "artifacts": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "object",
                                  "properties": {
                                    "totalArtifacts": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "groups": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "visibleOutputs": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runLocalStateArtifacts": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "totalArtifacts",
                                    "groups",
                                    "visibleOutputs",
                                    "runLocalStateArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                "groups": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "key": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "workspacePath": {
                                        "type": "string"
                                      },
                                      "latestArtifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "entries": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "artifact": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "taskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "operationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "artifactVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "type": {
                                                  "type": "string",
                                                  "enum": [
                                                    "text",
                                                    "json",
                                                    "image",
                                                    "file_reference",
                                                    "hitl_decision",
                                                    "manifest",
                                                    "log_chunk"
                                                  ]
                                                },
                                                "visibility": {
                                                  "type": "string",
                                                  "enum": [
                                                    "turn_input",
                                                    "task_output",
                                                    "run_local_state"
                                                  ]
                                                },
                                                "name": {
                                                  "type": "string"
                                                },
                                                "content": {
                                                  "type": "string"
                                                },
                                                "contentHash": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "mimeType": {
                                                  "type": "string"
                                                },
                                                "workspacePath": {
                                                  "type": "string"
                                                },
                                                "deleted": {
                                                  "type": "boolean"
                                                },
                                                "supersedesRunArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "type",
                                                "visibility",
                                                "name",
                                                "content",
                                                "mimeType",
                                                "deleted",
                                                "createdAt"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "turnNumber": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "producedByOperationId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "producedByTaskId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "consumedByTaskIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "diff": {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "added",
                                                    "updated",
                                                    "deleted",
                                                    "unchanged"
                                                  ]
                                                },
                                                "previousArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "addedLines": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "removedLines": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "beforePreview": {
                                                  "type": "string"
                                                },
                                                "afterPreview": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "addedLines",
                                                "removedLines",
                                                "summary"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "artifact",
                                            "consumedByTaskIds",
                                            "diff"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "key",
                                      "label",
                                      "latestArtifactId",
                                      "entries"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "summary",
                                "groups"
                              ],
                              "additionalProperties": false
                            },
                            "costs": {
                              "type": "object",
                              "properties": {
                                "totals": {
                                  "type": "object",
                                  "properties": {
                                    "operationCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "inputTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "outputTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "cacheReadTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "cacheWriteTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "reasoningTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "totalTokens": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCents": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "latencyMs": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "operationCount",
                                    "inputTokens",
                                    "outputTokens",
                                    "cacheReadTokens",
                                    "cacheWriteTokens",
                                    "reasoningTokens",
                                    "totalTokens",
                                    "costCents",
                                    "latencyMs"
                                  ],
                                  "additionalProperties": false
                                },
                                "counters": {
                                  "type": "object",
                                  "properties": {
                                    "runTokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "operationTokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokenDelta": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "runCostCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "operationCostCents": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costDeltaCents": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "runTokensUsed",
                                    "operationTokensUsed",
                                    "tokenDelta",
                                    "runCostCentsUsed",
                                    "operationCostCents",
                                    "costDeltaCents"
                                  ],
                                  "additionalProperties": false
                                },
                                "childRuns": {
                                  "type": "object",
                                  "properties": {
                                    "count": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "count",
                                    "tokensUsed",
                                    "costCentsUsed"
                                  ],
                                  "additionalProperties": false
                                },
                                "byType": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "key": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "operationCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "inputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "outputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheReadTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheWriteTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "reasoningTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "totalTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCents": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "latencyMs": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "key",
                                      "label",
                                      "operationCount",
                                      "inputTokens",
                                      "outputTokens",
                                      "cacheReadTokens",
                                      "cacheWriteTokens",
                                      "reasoningTokens",
                                      "totalTokens",
                                      "costCents",
                                      "latencyMs"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "byModel": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "key": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "operationCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "inputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "outputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheReadTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheWriteTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "reasoningTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "totalTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCents": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "latencyMs": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "key",
                                      "label",
                                      "operationCount",
                                      "inputTokens",
                                      "outputTokens",
                                      "cacheReadTokens",
                                      "cacheWriteTokens",
                                      "reasoningTokens",
                                      "totalTokens",
                                      "costCents",
                                      "latencyMs"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "byTurn": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "turnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "turnNumber": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "triggerKind": {
                                        "type": "string",
                                        "enum": [
                                          "initial_start",
                                          "user_message",
                                          "human_response",
                                          "child_run_result",
                                          "schedule_fire",
                                          "external_event",
                                          "cancel_run",
                                          "cancel_wait",
                                          "manual_resume",
                                          "wait_timeout",
                                          "recovery_resume",
                                          "knowledge_event"
                                        ]
                                      },
                                      "model": {
                                        "type": "string"
                                      },
                                      "operationCount": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "inputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "outputTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheReadTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "cacheWriteTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "reasoningTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "totalTokens": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "costCents": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "latencyMs": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "turnId",
                                      "turnNumber",
                                      "triggerKind",
                                      "operationCount",
                                      "inputTokens",
                                      "outputTokens",
                                      "cacheReadTokens",
                                      "cacheWriteTokens",
                                      "reasoningTokens",
                                      "totalTokens",
                                      "costCents",
                                      "latencyMs"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "totals",
                                "counters",
                                "childRuns",
                                "byType",
                                "byModel",
                                "byTurn"
                              ],
                              "additionalProperties": false
                            },
                            "lineage": {
                              "type": "object",
                              "properties": {
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "counts": {
                                  "type": "object",
                                  "properties": {
                                    "operations": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "skillVersions": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "artifacts": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "operations",
                                    "skillVersions",
                                    "artifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                "nodes": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "Run",
                                          "Operation",
                                          "SkillVersion",
                                          "Artifact"
                                        ]
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "subtitle": {
                                        "type": "string"
                                      },
                                      "occurredAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "status": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "kind",
                                      "title"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "edges": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "enum": [
                                          "ran_operation",
                                          "invoked_skill",
                                          "produced"
                                        ]
                                      },
                                      "fromKind": {
                                        "type": "string",
                                        "enum": [
                                          "Run",
                                          "Operation",
                                          "SkillVersion",
                                          "Artifact"
                                        ]
                                      },
                                      "fromId": {
                                        "type": "string"
                                      },
                                      "toKind": {
                                        "type": "string",
                                        "enum": [
                                          "Run",
                                          "Operation",
                                          "SkillVersion",
                                          "Artifact"
                                        ]
                                      },
                                      "toId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "fromKind",
                                      "fromId",
                                      "toKind",
                                      "toId"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "runId",
                                "counts",
                                "nodes",
                                "edges"
                              ],
                              "additionalProperties": false
                            },
                            "waits": {
                              "type": "object",
                              "properties": {
                                "runState": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "active",
                                    "closed",
                                    "failed",
                                    "abandoned"
                                  ]
                                },
                                "whyWaiting": {
                                  "type": "string"
                                },
                                "groups": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "waitGroup": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "runId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "tenantId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "projectId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "originatingRunTurnId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "resumePolicy": {
                                            "oneOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "all"
                                                  }
                                                },
                                                "required": [
                                                  "mode"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "any"
                                                  }
                                                },
                                                "required": [
                                                  "mode"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "mode": {
                                                    "type": "string",
                                                    "const": "count"
                                                  },
                                                  "requiredCount": {
                                                    "type": "integer",
                                                    "exclusiveMinimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "required": [
                                                  "mode",
                                                  "requiredCount"
                                                ],
                                                "additionalProperties": false
                                              }
                                            ]
                                          },
                                          "status": {
                                            "type": "string",
                                            "enum": [
                                              "active",
                                              "resolved",
                                              "cancelled",
                                              "timed_out"
                                            ]
                                          },
                                          "createdAt": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "resolvedAt": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "runId",
                                          "tenantId",
                                          "status",
                                          "createdAt"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "originatingTurnNumber": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "waitingExplanation": {
                                        "type": "string"
                                      },
                                      "resumeExplanation": {
                                        "type": "string"
                                      },
                                      "waits": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "wait": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runWaitGroupId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "originatingRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "blockingTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "kind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human_input",
                                                    "child_run",
                                                    "external_event"
                                                  ]
                                                },
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "active",
                                                    "resolved",
                                                    "timed_out",
                                                    "cancelled"
                                                  ]
                                                },
                                                "expectedTriggerKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human_response",
                                                    "child_run_result",
                                                    "external_event",
                                                    "wait_timeout"
                                                  ]
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "childRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "deadlineAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "timeoutPolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "fail_run",
                                                    "resume_with_timeout",
                                                    "cancel_run"
                                                  ]
                                                },
                                                "resolvedByTriggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "resolution": {
                                                  "oneOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "outcome": {
                                                          "type": "string",
                                                          "const": "resolved"
                                                        },
                                                        "triggerKind": {
                                                          "type": "string",
                                                          "enum": [
                                                            "initial_start",
                                                            "user_message",
                                                            "human_response",
                                                            "child_run_result",
                                                            "schedule_fire",
                                                            "external_event",
                                                            "cancel_run",
                                                            "cancel_wait",
                                                            "manual_resume",
                                                            "wait_timeout",
                                                            "recovery_resume",
                                                            "knowledge_event"
                                                          ]
                                                        },
                                                        "payload": {}
                                                      },
                                                      "required": [
                                                        "outcome",
                                                        "triggerKind",
                                                        "payload"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "outcome": {
                                                          "type": "string",
                                                          "const": "timed_out"
                                                        },
                                                        "waitKind": {
                                                          "type": "string",
                                                          "enum": [
                                                            "human_input",
                                                            "child_run",
                                                            "external_event"
                                                          ]
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string"
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "outcome",
                                                        "waitKind",
                                                        "deadlineAt",
                                                        "timeoutPolicy"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "outcome": {
                                                          "type": "string",
                                                          "const": "cancelled"
                                                        },
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "outcome"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "resolvedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runWaitGroupId",
                                                "runId",
                                                "tenantId",
                                                "kind",
                                                "status",
                                                "expectedTriggerKind",
                                                "timeoutPolicy",
                                                "createdAt"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "originatingTurnNumber": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "blockingTask": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "role": {
                                                  "type": "string",
                                                  "enum": [
                                                    "tool",
                                                    "skill",
                                                    "human_input",
                                                    "child_run",
                                                    "external_wait"
                                                  ]
                                                },
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "running",
                                                    "completed",
                                                    "failed",
                                                    "abandoned",
                                                    "skipped",
                                                    "cancelled"
                                                  ]
                                                },
                                                "sequenceNumber": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "skillName": {
                                                  "type": "string"
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "request": {
                                                  "oneOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "tool"
                                                        },
                                                        "toolName": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "args": {},
                                                        "toolUseId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "toolName",
                                                        "args"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "skill"
                                                        },
                                                        "skillHandle": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "input": {},
                                                        "artifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "context": {}
                                                      },
                                                      "required": [
                                                        "role",
                                                        "skillHandle",
                                                        "input"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "oneOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "human_input"
                                                            },
                                                            "title": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "prompt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "relatedArtifactIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "allowedResponders": {
                                                              "type": "object",
                                                              "properties": {
                                                                "userIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "roleIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                }
                                                              },
                                                              "additionalProperties": false
                                                            },
                                                            "deadlineAt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "timeoutPolicy": {
                                                              "type": "string",
                                                              "enum": [
                                                                "fail_run",
                                                                "resume_with_timeout",
                                                                "cancel_run"
                                                              ]
                                                            },
                                                            "requestType": {
                                                              "type": "string",
                                                              "const": "approval"
                                                            },
                                                            "proposedActionSummary": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "approvalSubject": {
                                                              "oneOf": [
                                                                {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "kind": {
                                                                      "type": "string",
                                                                      "const": "skill_activation"
                                                                    },
                                                                    "skillHandle": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "skillId": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "skillVersionId": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "toolUseId": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "request": {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "input": {},
                                                                        "artifactIds": {
                                                                          "type": "array",
                                                                          "items": {
                                                                            "type": "string",
                                                                            "minLength": 1
                                                                          }
                                                                        },
                                                                        "context": {}
                                                                      },
                                                                      "additionalProperties": false
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "kind",
                                                                    "skillHandle",
                                                                    "skillId",
                                                                    "request"
                                                                  ],
                                                                  "additionalProperties": false
                                                                },
                                                                {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "kind": {
                                                                      "type": "string",
                                                                      "const": "tool_activation"
                                                                    },
                                                                    "toolName": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "connectorId": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "toolUseId": {
                                                                      "type": "string",
                                                                      "minLength": 1
                                                                    },
                                                                    "request": {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "args": {}
                                                                      },
                                                                      "required": [
                                                                        "args"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "kind",
                                                                    "toolName",
                                                                    "connectorId",
                                                                    "request"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "title",
                                                            "prompt",
                                                            "relatedArtifactIds",
                                                            "allowedResponders",
                                                            "timeoutPolicy",
                                                            "requestType",
                                                            "proposedActionSummary"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "human_input"
                                                            },
                                                            "title": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "prompt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "relatedArtifactIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "allowedResponders": {
                                                              "type": "object",
                                                              "properties": {
                                                                "userIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "roleIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                }
                                                              },
                                                              "additionalProperties": false
                                                            },
                                                            "deadlineAt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "timeoutPolicy": {
                                                              "type": "string",
                                                              "enum": [
                                                                "fail_run",
                                                                "resume_with_timeout",
                                                                "cancel_run"
                                                              ]
                                                            },
                                                            "requestType": {
                                                              "type": "string",
                                                              "const": "selection"
                                                            },
                                                            "options": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "label": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "description": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "label"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "allowMultiple": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "title",
                                                            "prompt",
                                                            "relatedArtifactIds",
                                                            "allowedResponders",
                                                            "timeoutPolicy",
                                                            "requestType",
                                                            "options"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "human_input"
                                                            },
                                                            "title": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "prompt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "relatedArtifactIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "allowedResponders": {
                                                              "type": "object",
                                                              "properties": {
                                                                "userIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "roleIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                }
                                                              },
                                                              "additionalProperties": false
                                                            },
                                                            "deadlineAt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "timeoutPolicy": {
                                                              "type": "string",
                                                              "enum": [
                                                                "fail_run",
                                                                "resume_with_timeout",
                                                                "cancel_run"
                                                              ]
                                                            },
                                                            "requestType": {
                                                              "type": "string",
                                                              "const": "freeform"
                                                            },
                                                            "responseHint": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "title",
                                                            "prompt",
                                                            "relatedArtifactIds",
                                                            "allowedResponders",
                                                            "timeoutPolicy",
                                                            "requestType"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "human_input"
                                                            },
                                                            "title": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "prompt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "relatedArtifactIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "allowedResponders": {
                                                              "type": "object",
                                                              "properties": {
                                                                "userIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "roleIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                }
                                                              },
                                                              "additionalProperties": false
                                                            },
                                                            "deadlineAt": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "timeoutPolicy": {
                                                              "type": "string",
                                                              "enum": [
                                                                "fail_run",
                                                                "resume_with_timeout",
                                                                "cancel_run"
                                                              ]
                                                            },
                                                            "requestType": {
                                                              "type": "string",
                                                              "const": "structured"
                                                            },
                                                            "responseSchema": {}
                                                          },
                                                          "required": [
                                                            "role",
                                                            "title",
                                                            "prompt",
                                                            "relatedArtifactIds",
                                                            "allowedResponders",
                                                            "timeoutPolicy",
                                                            "requestType",
                                                            "responseSchema"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "child_run"
                                                        },
                                                        "childRunId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "agentId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "input": {},
                                                        "title": {
                                                          "type": "string"
                                                        },
                                                        "runtimeHint": {
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "modelId": {
                                                          "type": "string"
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "artifactInputs": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "expectedOutputSchema": {},
                                                        "delegationReason": {
                                                          "type": "string"
                                                        },
                                                        "resumePolicy": {
                                                          "oneOf": [
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "mode": {
                                                                  "type": "string",
                                                                  "const": "all"
                                                                }
                                                              },
                                                              "required": [
                                                                "mode"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "mode": {
                                                                  "type": "string",
                                                                  "const": "any"
                                                                }
                                                              },
                                                              "required": [
                                                                "mode"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "mode": {
                                                                  "type": "string",
                                                                  "const": "count"
                                                                },
                                                                "requiredCount": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "mode",
                                                                "requiredCount"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          ]
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "prompt",
                                                        "agentId",
                                                        "timeoutPolicy"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "external_wait"
                                                        },
                                                        "eventName": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "matchKey": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string"
                                                        },
                                                        "expectedPayloadSchema": {},
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "eventName",
                                                        "matchKey",
                                                        "timeoutPolicy"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                },
                                                "result": {
                                                  "oneOf": [
                                                    {
                                                      "oneOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "tool"
                                                            },
                                                            "outcome": {
                                                              "type": "string",
                                                              "const": "completed"
                                                            },
                                                            "output": {},
                                                            "artifactIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "outcome"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "tool"
                                                            },
                                                            "outcome": {
                                                              "type": "string",
                                                              "const": "waiting"
                                                            },
                                                            "waitId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "waitGroupId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "outcome",
                                                            "waitId",
                                                            "waitGroupId"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "role": {
                                                              "type": "string",
                                                              "const": "tool"
                                                            },
                                                            "outcome": {
                                                              "type": "string",
                                                              "enum": [
                                                                "failed",
                                                                "skipped",
                                                                "abandoned",
                                                                "cancelled"
                                                              ]
                                                            },
                                                            "reason": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "role",
                                                            "outcome",
                                                            "reason"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "skill"
                                                        },
                                                        "outcome": {
                                                          "type": "string",
                                                          "enum": [
                                                            "completed",
                                                            "failed",
                                                            "abandoned",
                                                            "cancelled"
                                                          ]
                                                        },
                                                        "output": {},
                                                        "artifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "outcome"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "human_input"
                                                        },
                                                        "runWaitId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "requestTaskId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "responder": {
                                                          "type": "object",
                                                          "properties": {
                                                            "userId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "tenantId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "roleIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "userId",
                                                            "tenantId",
                                                            "roleIds"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "respondedAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "decision": {
                                                          "oneOf": [
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "type": {
                                                                  "type": "string",
                                                                  "const": "approved"
                                                                },
                                                                "note": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "type"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "type": {
                                                                  "type": "string",
                                                                  "const": "rejected"
                                                                },
                                                                "note": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "type"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "type": {
                                                                  "type": "string",
                                                                  "const": "selected"
                                                                },
                                                                "optionIds": {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "note": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "type",
                                                                "optionIds"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "type": {
                                                                  "type": "string",
                                                                  "const": "freeform"
                                                                },
                                                                "text": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                }
                                                              },
                                                              "required": [
                                                                "type",
                                                                "text"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "type": {
                                                                  "type": "string",
                                                                  "const": "structured"
                                                                },
                                                                "value": {}
                                                              },
                                                              "required": [
                                                                "type",
                                                                "value"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "runWaitId",
                                                        "requestTaskId",
                                                        "responder",
                                                        "respondedAt",
                                                        "decision"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "child_run"
                                                        },
                                                        "childRunId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "finalState": {
                                                          "type": "string",
                                                          "enum": [
                                                            "closed",
                                                            "failed",
                                                            "abandoned"
                                                          ]
                                                        },
                                                        "manifestArtifactId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "visibleOutputArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "visibleOutputArtifacts": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "artifactId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "name": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "type": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "workspacePath": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "contentHash": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "required": [
                                                              "artifactId",
                                                              "name",
                                                              "type",
                                                              "contentHash"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "summary": {
                                                          "type": "string"
                                                        },
                                                        "costCentsUsed": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "tokensUsed": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "runtimePolicyUsed": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "output": {},
                                                        "outputSchema": {}
                                                      },
                                                      "required": [
                                                        "role",
                                                        "childRunId",
                                                        "finalState",
                                                        "visibleOutputArtifactIds",
                                                        "visibleOutputArtifacts"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "external_wait"
                                                        },
                                                        "eventName": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "matchKey": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "occurredAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "data": {},
                                                        "producer": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "eventName",
                                                        "matchKey",
                                                        "occurredAt",
                                                        "data"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                },
                                                "responderId": {
                                                  "type": "string"
                                                },
                                                "claimedByUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "claimedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "childRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "groupId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "expiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "role",
                                                "status",
                                                "sequenceNumber",
                                                "createdAt",
                                                "updatedAt"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "childRun": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "actorKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human",
                                                        "agent"
                                                      ]
                                                    },
                                                    "actorId": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      ]
                                                    },
                                                    "parentRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "parentTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "conversationId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "triggerDeliveryId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "evalRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "replayOfRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "goalId": {
                                                      "type": "string"
                                                    },
                                                    "input": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {}
                                                    },
                                                    "messageCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "behaviorSnapshot": {
                                                      "type": "object",
                                                      "properties": {
                                                        "agentPromptVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "pinnedSkills": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "skillVersionId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "executionMode": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "prompt",
                                                                  "code"
                                                                ]
                                                              },
                                                              "allowedTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "body": {
                                                                "type": "string"
                                                              },
                                                              "bundleRef": {
                                                                "type": "string"
                                                              },
                                                              "bundleHash": {
                                                                "type": "string"
                                                              },
                                                              "metadata": {}
                                                            },
                                                            "required": [
                                                              "skillVersionId",
                                                              "executionMode",
                                                              "metadata"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "skillPolicies": {},
                                                        "model": {
                                                          "type": "object",
                                                          "properties": {
                                                            "id": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "provider": {
                                                              "type": "string"
                                                            },
                                                            "params": {},
                                                            "temperature": {
                                                              "type": "number",
                                                              "minimum": 0,
                                                              "maximum": 2
                                                            },
                                                            "reasoning": {
                                                              "type": "string",
                                                              "enum": [
                                                                "off",
                                                                "low",
                                                                "medium",
                                                                "high",
                                                                "xhigh",
                                                                "max"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "id",
                                                            "params"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "modelRoutingPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptTemplate": {
                                                          "type": "string"
                                                        },
                                                        "systemPromptTemplateHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "toolCatalogHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "harness": {
                                                          "type": "object",
                                                          "properties": {
                                                            "version": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "scoringVersion": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "version",
                                                            "scoringVersion"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "closePolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "explicit",
                                                            "auto_on_idle",
                                                            "auto_on_parent_delivery"
                                                          ]
                                                        },
                                                        "wakePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "manual": {
                                                              "type": "boolean"
                                                            },
                                                            "schedules": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "cron": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "deliveryPolicy": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                      "latest",
                                                                      "all",
                                                                      "count_only"
                                                                    ]
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "cron",
                                                                  "deliveryPolicy"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "events": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "eventName": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "matchKey": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "eventName"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "manual",
                                                            "schedules",
                                                            "events"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "resourcePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "behavioral": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            },
                                                            "reference": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "behavioral",
                                                            "reference"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "runtimePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "goalVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "corpusVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "outputSchema": {},
                                                        "packId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packBindings": {
                                                          "default": [],
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "requirementKey": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "packBindingId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "targetKind": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "connector",
                                                                  "corpus"
                                                                ]
                                                              },
                                                              "targetId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "enabledTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "policyOverrides": {}
                                                            },
                                                            "required": [
                                                              "requirementKey",
                                                              "packBindingId",
                                                              "targetKind",
                                                              "targetId"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "pinnedSkills",
                                                        "skillPolicies",
                                                        "model",
                                                        "systemPromptTemplate",
                                                        "systemPromptTemplateHash",
                                                        "toolCatalogHash",
                                                        "harness",
                                                        "closePolicy",
                                                        "wakePolicy",
                                                        "resourcePolicy",
                                                        "runtimePolicy",
                                                        "budgetPolicy",
                                                        "packBindings"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "shareToken": {
                                                      "type": "string"
                                                    },
                                                    "shareExpiresAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "artifactVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "artifactVersionId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "pinnedVersions": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "waitingOnUserId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceBranchId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceOwnershipKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "auto_created",
                                                        "user_specified",
                                                        "inherited_from_parent"
                                                      ]
                                                    },
                                                    "executionRuntimeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceModeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "archivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "deletedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "createdAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "updatedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "state": {
                                                      "type": "string",
                                                      "const": "pending"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "tenantId",
                                                    "title",
                                                    "actorKind",
                                                    "actorId",
                                                    "messageCount",
                                                    "tokensUsed",
                                                    "costCentsUsed",
                                                    "executionRuntimeDerived",
                                                    "workspaceModeDerived",
                                                    "createdAt",
                                                    "updatedAt",
                                                    "state"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "actorKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human",
                                                        "agent"
                                                      ]
                                                    },
                                                    "actorId": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      ]
                                                    },
                                                    "parentRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "parentTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "conversationId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "triggerDeliveryId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "evalRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "replayOfRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "goalId": {
                                                      "type": "string"
                                                    },
                                                    "input": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {}
                                                    },
                                                    "messageCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "behaviorSnapshot": {
                                                      "type": "object",
                                                      "properties": {
                                                        "agentPromptVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "pinnedSkills": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "skillVersionId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "executionMode": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "prompt",
                                                                  "code"
                                                                ]
                                                              },
                                                              "allowedTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "body": {
                                                                "type": "string"
                                                              },
                                                              "bundleRef": {
                                                                "type": "string"
                                                              },
                                                              "bundleHash": {
                                                                "type": "string"
                                                              },
                                                              "metadata": {}
                                                            },
                                                            "required": [
                                                              "skillVersionId",
                                                              "executionMode",
                                                              "metadata"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "skillPolicies": {},
                                                        "model": {
                                                          "type": "object",
                                                          "properties": {
                                                            "id": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "provider": {
                                                              "type": "string"
                                                            },
                                                            "params": {},
                                                            "temperature": {
                                                              "type": "number",
                                                              "minimum": 0,
                                                              "maximum": 2
                                                            },
                                                            "reasoning": {
                                                              "type": "string",
                                                              "enum": [
                                                                "off",
                                                                "low",
                                                                "medium",
                                                                "high",
                                                                "xhigh",
                                                                "max"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "id",
                                                            "params"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "modelRoutingPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptTemplate": {
                                                          "type": "string"
                                                        },
                                                        "systemPromptTemplateHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "toolCatalogHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "harness": {
                                                          "type": "object",
                                                          "properties": {
                                                            "version": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "scoringVersion": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "version",
                                                            "scoringVersion"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "closePolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "explicit",
                                                            "auto_on_idle",
                                                            "auto_on_parent_delivery"
                                                          ]
                                                        },
                                                        "wakePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "manual": {
                                                              "type": "boolean"
                                                            },
                                                            "schedules": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "cron": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "deliveryPolicy": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                      "latest",
                                                                      "all",
                                                                      "count_only"
                                                                    ]
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "cron",
                                                                  "deliveryPolicy"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "events": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "eventName": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "matchKey": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "eventName"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "manual",
                                                            "schedules",
                                                            "events"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "resourcePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "behavioral": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            },
                                                            "reference": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "behavioral",
                                                            "reference"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "runtimePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "goalVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "corpusVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "outputSchema": {},
                                                        "packId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packBindings": {
                                                          "default": [],
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "requirementKey": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "packBindingId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "targetKind": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "connector",
                                                                  "corpus"
                                                                ]
                                                              },
                                                              "targetId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "enabledTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "policyOverrides": {}
                                                            },
                                                            "required": [
                                                              "requirementKey",
                                                              "packBindingId",
                                                              "targetKind",
                                                              "targetId"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "pinnedSkills",
                                                        "skillPolicies",
                                                        "model",
                                                        "systemPromptTemplate",
                                                        "systemPromptTemplateHash",
                                                        "toolCatalogHash",
                                                        "harness",
                                                        "closePolicy",
                                                        "wakePolicy",
                                                        "resourcePolicy",
                                                        "runtimePolicy",
                                                        "budgetPolicy",
                                                        "packBindings"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "shareToken": {
                                                      "type": "string"
                                                    },
                                                    "shareExpiresAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "artifactVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "artifactVersionId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "pinnedVersions": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "waitingOnUserId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceBranchId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceOwnershipKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "auto_created",
                                                        "user_specified",
                                                        "inherited_from_parent"
                                                      ]
                                                    },
                                                    "executionRuntimeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceModeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "archivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "deletedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "createdAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "updatedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "state": {
                                                      "type": "string",
                                                      "const": "active"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "tenantId",
                                                    "title",
                                                    "actorKind",
                                                    "actorId",
                                                    "messageCount",
                                                    "tokensUsed",
                                                    "costCentsUsed",
                                                    "executionRuntimeDerived",
                                                    "workspaceModeDerived",
                                                    "createdAt",
                                                    "updatedAt",
                                                    "state"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "actorKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human",
                                                        "agent"
                                                      ]
                                                    },
                                                    "actorId": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      ]
                                                    },
                                                    "parentRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "parentTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "conversationId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "triggerDeliveryId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "evalRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "replayOfRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "goalId": {
                                                      "type": "string"
                                                    },
                                                    "input": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {}
                                                    },
                                                    "messageCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "behaviorSnapshot": {
                                                      "type": "object",
                                                      "properties": {
                                                        "agentPromptVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "pinnedSkills": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "skillVersionId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "executionMode": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "prompt",
                                                                  "code"
                                                                ]
                                                              },
                                                              "allowedTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "body": {
                                                                "type": "string"
                                                              },
                                                              "bundleRef": {
                                                                "type": "string"
                                                              },
                                                              "bundleHash": {
                                                                "type": "string"
                                                              },
                                                              "metadata": {}
                                                            },
                                                            "required": [
                                                              "skillVersionId",
                                                              "executionMode",
                                                              "metadata"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "skillPolicies": {},
                                                        "model": {
                                                          "type": "object",
                                                          "properties": {
                                                            "id": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "provider": {
                                                              "type": "string"
                                                            },
                                                            "params": {},
                                                            "temperature": {
                                                              "type": "number",
                                                              "minimum": 0,
                                                              "maximum": 2
                                                            },
                                                            "reasoning": {
                                                              "type": "string",
                                                              "enum": [
                                                                "off",
                                                                "low",
                                                                "medium",
                                                                "high",
                                                                "xhigh",
                                                                "max"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "id",
                                                            "params"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "modelRoutingPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptTemplate": {
                                                          "type": "string"
                                                        },
                                                        "systemPromptTemplateHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "toolCatalogHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "harness": {
                                                          "type": "object",
                                                          "properties": {
                                                            "version": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "scoringVersion": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "version",
                                                            "scoringVersion"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "closePolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "explicit",
                                                            "auto_on_idle",
                                                            "auto_on_parent_delivery"
                                                          ]
                                                        },
                                                        "wakePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "manual": {
                                                              "type": "boolean"
                                                            },
                                                            "schedules": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "cron": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "deliveryPolicy": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                      "latest",
                                                                      "all",
                                                                      "count_only"
                                                                    ]
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "cron",
                                                                  "deliveryPolicy"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "events": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "eventName": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "matchKey": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "eventName"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "manual",
                                                            "schedules",
                                                            "events"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "resourcePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "behavioral": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            },
                                                            "reference": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "behavioral",
                                                            "reference"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "runtimePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "goalVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "corpusVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "outputSchema": {},
                                                        "packId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packBindings": {
                                                          "default": [],
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "requirementKey": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "packBindingId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "targetKind": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "connector",
                                                                  "corpus"
                                                                ]
                                                              },
                                                              "targetId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "enabledTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "policyOverrides": {}
                                                            },
                                                            "required": [
                                                              "requirementKey",
                                                              "packBindingId",
                                                              "targetKind",
                                                              "targetId"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "pinnedSkills",
                                                        "skillPolicies",
                                                        "model",
                                                        "systemPromptTemplate",
                                                        "systemPromptTemplateHash",
                                                        "toolCatalogHash",
                                                        "harness",
                                                        "closePolicy",
                                                        "wakePolicy",
                                                        "resourcePolicy",
                                                        "runtimePolicy",
                                                        "budgetPolicy",
                                                        "packBindings"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "shareToken": {
                                                      "type": "string"
                                                    },
                                                    "shareExpiresAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "artifactVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "artifactVersionId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "pinnedVersions": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "waitingOnUserId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceBranchId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceOwnershipKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "auto_created",
                                                        "user_specified",
                                                        "inherited_from_parent"
                                                      ]
                                                    },
                                                    "executionRuntimeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceModeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "archivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "deletedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "createdAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "updatedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "state": {
                                                      "type": "string",
                                                      "const": "closed"
                                                    },
                                                    "output": {}
                                                  },
                                                  "required": [
                                                    "id",
                                                    "tenantId",
                                                    "title",
                                                    "actorKind",
                                                    "actorId",
                                                    "messageCount",
                                                    "tokensUsed",
                                                    "costCentsUsed",
                                                    "executionRuntimeDerived",
                                                    "workspaceModeDerived",
                                                    "createdAt",
                                                    "updatedAt",
                                                    "state"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "actorKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human",
                                                        "agent"
                                                      ]
                                                    },
                                                    "actorId": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      ]
                                                    },
                                                    "parentRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "parentTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "conversationId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "triggerDeliveryId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "evalRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "replayOfRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "goalId": {
                                                      "type": "string"
                                                    },
                                                    "input": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {}
                                                    },
                                                    "messageCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "behaviorSnapshot": {
                                                      "type": "object",
                                                      "properties": {
                                                        "agentPromptVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "pinnedSkills": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "skillVersionId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "executionMode": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "prompt",
                                                                  "code"
                                                                ]
                                                              },
                                                              "allowedTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "body": {
                                                                "type": "string"
                                                              },
                                                              "bundleRef": {
                                                                "type": "string"
                                                              },
                                                              "bundleHash": {
                                                                "type": "string"
                                                              },
                                                              "metadata": {}
                                                            },
                                                            "required": [
                                                              "skillVersionId",
                                                              "executionMode",
                                                              "metadata"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "skillPolicies": {},
                                                        "model": {
                                                          "type": "object",
                                                          "properties": {
                                                            "id": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "provider": {
                                                              "type": "string"
                                                            },
                                                            "params": {},
                                                            "temperature": {
                                                              "type": "number",
                                                              "minimum": 0,
                                                              "maximum": 2
                                                            },
                                                            "reasoning": {
                                                              "type": "string",
                                                              "enum": [
                                                                "off",
                                                                "low",
                                                                "medium",
                                                                "high",
                                                                "xhigh",
                                                                "max"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "id",
                                                            "params"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "modelRoutingPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptTemplate": {
                                                          "type": "string"
                                                        },
                                                        "systemPromptTemplateHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "toolCatalogHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "harness": {
                                                          "type": "object",
                                                          "properties": {
                                                            "version": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "scoringVersion": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "version",
                                                            "scoringVersion"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "closePolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "explicit",
                                                            "auto_on_idle",
                                                            "auto_on_parent_delivery"
                                                          ]
                                                        },
                                                        "wakePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "manual": {
                                                              "type": "boolean"
                                                            },
                                                            "schedules": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "cron": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "deliveryPolicy": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                      "latest",
                                                                      "all",
                                                                      "count_only"
                                                                    ]
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "cron",
                                                                  "deliveryPolicy"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "events": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "eventName": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "matchKey": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "eventName"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "manual",
                                                            "schedules",
                                                            "events"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "resourcePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "behavioral": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            },
                                                            "reference": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "behavioral",
                                                            "reference"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "runtimePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "goalVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "corpusVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "outputSchema": {},
                                                        "packId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packBindings": {
                                                          "default": [],
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "requirementKey": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "packBindingId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "targetKind": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "connector",
                                                                  "corpus"
                                                                ]
                                                              },
                                                              "targetId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "enabledTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "policyOverrides": {}
                                                            },
                                                            "required": [
                                                              "requirementKey",
                                                              "packBindingId",
                                                              "targetKind",
                                                              "targetId"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "pinnedSkills",
                                                        "skillPolicies",
                                                        "model",
                                                        "systemPromptTemplate",
                                                        "systemPromptTemplateHash",
                                                        "toolCatalogHash",
                                                        "harness",
                                                        "closePolicy",
                                                        "wakePolicy",
                                                        "resourcePolicy",
                                                        "runtimePolicy",
                                                        "budgetPolicy",
                                                        "packBindings"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "shareToken": {
                                                      "type": "string"
                                                    },
                                                    "shareExpiresAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "artifactVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "artifactVersionId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "pinnedVersions": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "waitingOnUserId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceBranchId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceOwnershipKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "auto_created",
                                                        "user_specified",
                                                        "inherited_from_parent"
                                                      ]
                                                    },
                                                    "executionRuntimeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceModeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "archivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "deletedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "createdAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "updatedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "state": {
                                                      "type": "string",
                                                      "const": "failed"
                                                    },
                                                    "failureReason": {
                                                      "type": "string"
                                                    },
                                                    "failureCategory": {
                                                      "type": "string",
                                                      "enum": [
                                                        "provider_error",
                                                        "invariant_violation",
                                                        "unhandled_exception",
                                                        "dependency_unavailable"
                                                      ]
                                                    },
                                                    "failureDetail": {}
                                                  },
                                                  "required": [
                                                    "id",
                                                    "tenantId",
                                                    "title",
                                                    "actorKind",
                                                    "actorId",
                                                    "messageCount",
                                                    "tokensUsed",
                                                    "costCentsUsed",
                                                    "executionRuntimeDerived",
                                                    "workspaceModeDerived",
                                                    "createdAt",
                                                    "updatedAt",
                                                    "state",
                                                    "failureReason",
                                                    "failureCategory"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "actorKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human",
                                                        "agent"
                                                      ]
                                                    },
                                                    "actorId": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      ]
                                                    },
                                                    "parentRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "parentTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "spawnedByTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "conversationId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "triggerDeliveryId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "evalRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "replayOfRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "goalId": {
                                                      "type": "string"
                                                    },
                                                    "input": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {}
                                                    },
                                                    "messageCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "behaviorSnapshot": {
                                                      "type": "object",
                                                      "properties": {
                                                        "agentPromptVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "pinnedSkills": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "skillVersionId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "executionMode": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "prompt",
                                                                  "code"
                                                                ]
                                                              },
                                                              "allowedTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "body": {
                                                                "type": "string"
                                                              },
                                                              "bundleRef": {
                                                                "type": "string"
                                                              },
                                                              "bundleHash": {
                                                                "type": "string"
                                                              },
                                                              "metadata": {}
                                                            },
                                                            "required": [
                                                              "skillVersionId",
                                                              "executionMode",
                                                              "metadata"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "skillPolicies": {},
                                                        "model": {
                                                          "type": "object",
                                                          "properties": {
                                                            "id": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "provider": {
                                                              "type": "string"
                                                            },
                                                            "params": {},
                                                            "temperature": {
                                                              "type": "number",
                                                              "minimum": 0,
                                                              "maximum": 2
                                                            },
                                                            "reasoning": {
                                                              "type": "string",
                                                              "enum": [
                                                                "off",
                                                                "low",
                                                                "medium",
                                                                "high",
                                                                "xhigh",
                                                                "max"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "id",
                                                            "params"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "modelRoutingPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptTemplate": {
                                                          "type": "string"
                                                        },
                                                        "systemPromptTemplateHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "toolCatalogHash": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "harness": {
                                                          "type": "object",
                                                          "properties": {
                                                            "version": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            },
                                                            "scoringVersion": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "version",
                                                            "scoringVersion"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "closePolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "explicit",
                                                            "auto_on_idle",
                                                            "auto_on_parent_delivery"
                                                          ]
                                                        },
                                                        "wakePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "manual": {
                                                              "type": "boolean"
                                                            },
                                                            "schedules": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "id": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "cron": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "deliveryPolicy": {
                                                                    "type": "string",
                                                                    "enum": [
                                                                      "latest",
                                                                      "all",
                                                                      "count_only"
                                                                    ]
                                                                  }
                                                                },
                                                                "required": [
                                                                  "id",
                                                                  "cron",
                                                                  "deliveryPolicy"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            },
                                                            "events": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                  "eventName": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  },
                                                                  "matchKey": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "required": [
                                                                  "eventName"
                                                                ],
                                                                "additionalProperties": false
                                                              }
                                                            }
                                                          },
                                                          "required": [
                                                            "manual",
                                                            "schedules",
                                                            "events"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "resourcePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "behavioral": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            },
                                                            "reference": {
                                                              "type": "string",
                                                              "enum": [
                                                                "pin_on_run_start",
                                                                "follow_latest_on_turn_start"
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "behavioral",
                                                            "reference"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "runtimePolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "budgetPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "maxTokensPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerRun": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxTokensPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            },
                                                            "maxCostCentsPerTurn": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "goalVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "corpusVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "outputSchema": {},
                                                        "packId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packVersionId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "packBindings": {
                                                          "default": [],
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "requirementKey": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "packBindingId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "targetKind": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "connector",
                                                                  "corpus"
                                                                ]
                                                              },
                                                              "targetId": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "enabledTools": {
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "policyOverrides": {}
                                                            },
                                                            "required": [
                                                              "requirementKey",
                                                              "packBindingId",
                                                              "targetKind",
                                                              "targetId"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "pinnedSkills",
                                                        "skillPolicies",
                                                        "model",
                                                        "systemPromptTemplate",
                                                        "systemPromptTemplateHash",
                                                        "toolCatalogHash",
                                                        "harness",
                                                        "closePolicy",
                                                        "wakePolicy",
                                                        "resourcePolicy",
                                                        "runtimePolicy",
                                                        "budgetPolicy",
                                                        "packBindings"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "shareToken": {
                                                      "type": "string"
                                                    },
                                                    "shareExpiresAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "artifactVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "artifactVersionId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "pinnedVersions": {
                                                      "type": "object",
                                                      "propertyNames": {
                                                        "type": "string"
                                                      },
                                                      "additionalProperties": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "waitingOnUserId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceBranchId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "workspaceOwnershipKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "auto_created",
                                                        "user_specified",
                                                        "inherited_from_parent"
                                                      ]
                                                    },
                                                    "executionRuntimeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceModeDerived": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "archivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "deletedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "createdAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "updatedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "state": {
                                                      "type": "string",
                                                      "const": "abandoned"
                                                    },
                                                    "abandonReason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "tenantId",
                                                    "title",
                                                    "actorKind",
                                                    "actorId",
                                                    "messageCount",
                                                    "tokensUsed",
                                                    "costCentsUsed",
                                                    "executionRuntimeDerived",
                                                    "workspaceModeDerived",
                                                    "createdAt",
                                                    "updatedAt",
                                                    "state",
                                                    "abandonReason"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "resolvedByDelivery": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "initial_start"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "userMessage": {
                                                          "type": "string"
                                                        },
                                                        "forkedFromRunId": {
                                                          "type": "string"
                                                        },
                                                        "forkedFromTurnId": {
                                                          "type": "string"
                                                        },
                                                        "idempotencyDomain": {
                                                          "type": "string"
                                                        },
                                                        "modelId": {
                                                          "type": "string"
                                                        },
                                                        "modelRoutingPolicyOverride": {
                                                          "type": "object",
                                                          "properties": {
                                                            "preferredProviderId": {
                                                              "type": "string"
                                                            },
                                                            "credentialId": {
                                                              "type": "string"
                                                            },
                                                            "allowPlatformCredentials": {
                                                              "type": "boolean"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "systemPromptOverride": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "userMessage"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "user_message"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "messageId": {
                                                          "type": "string"
                                                        },
                                                        "content": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "messageId",
                                                        "content"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "human_response"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "runWaitId": {
                                                          "type": "string"
                                                        },
                                                        "response": {
                                                          "anyOf": [
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "decision": {
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "approved",
                                                                    "rejected"
                                                                  ]
                                                                },
                                                                "note": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "decision"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "optionIds": {
                                                                  "minItems": 1,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string"
                                                                  }
                                                                },
                                                                "note": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "optionIds"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "text": {
                                                                  "type": "string"
                                                                }
                                                              },
                                                              "required": [
                                                                "text"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "value": {}
                                                              },
                                                              "required": [
                                                                "value"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "runWaitId",
                                                        "response"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "child_run_result"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "childRunId": {
                                                          "type": "string"
                                                        },
                                                        "childTaskId": {
                                                          "type": "string"
                                                        },
                                                        "finalState": {
                                                          "type": "string",
                                                          "enum": [
                                                            "closed",
                                                            "failed",
                                                            "abandoned"
                                                          ]
                                                        },
                                                        "manifestArtifactId": {
                                                          "type": "string"
                                                        },
                                                        "visibleOutputArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "visibleOutputArtifacts": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "artifactId": {
                                                                "type": "string"
                                                              },
                                                              "name": {
                                                                "type": "string"
                                                              },
                                                              "type": {
                                                                "type": "string"
                                                              },
                                                              "workspacePath": {
                                                                "type": "string"
                                                              },
                                                              "contentHash": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "artifactId",
                                                              "name",
                                                              "type",
                                                              "contentHash"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "summary": {
                                                          "type": "string"
                                                        },
                                                        "tokensUsed": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "costCentsUsed": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "runtimePolicyUsed": {
                                                          "type": "object",
                                                          "properties": {
                                                            "sandboxLifecycle": {
                                                              "type": "string",
                                                              "enum": [
                                                                "ephemeral_per_turn",
                                                                "snapshot_to_r2",
                                                                "warm_per_run"
                                                              ]
                                                            },
                                                            "executionRuntime": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "fast_virtual",
                                                                "dynamic_worker",
                                                                "required_full_os"
                                                              ]
                                                            },
                                                            "workspaceMode": {
                                                              "default": "none",
                                                              "type": "string",
                                                              "enum": [
                                                                "none",
                                                                "persistent"
                                                              ]
                                                            },
                                                            "directToolPolicy": {
                                                              "type": "object",
                                                              "properties": {
                                                                "workspaceWritePrefixes": {
                                                                  "maxItems": 100,
                                                                  "type": "array",
                                                                  "items": {
                                                                    "type": "string",
                                                                    "minLength": 1
                                                                  }
                                                                },
                                                                "destructiveCommands": {
                                                                  "default": "allow",
                                                                  "type": "string",
                                                                  "enum": [
                                                                    "allow",
                                                                    "deny"
                                                                  ]
                                                                },
                                                                "codemode": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "enabled": {
                                                                      "default": true,
                                                                      "type": "boolean"
                                                                    },
                                                                    "minEligibleTools": {
                                                                      "default": 5,
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 1000
                                                                    },
                                                                    "timeoutMs": {
                                                                      "type": "integer",
                                                                      "exclusiveMinimum": 0,
                                                                      "maximum": 9007199254740991
                                                                    }
                                                                  },
                                                                  "required": [
                                                                    "enabled",
                                                                    "minEligibleTools"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "destructiveCommands"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            "automationTest": {
                                                              "type": "boolean"
                                                            },
                                                            "automationRun": {
                                                              "type": "boolean"
                                                            },
                                                            "automationBrainAccess": {
                                                              "type": "string",
                                                              "enum": [
                                                                "read_only",
                                                                "read_write"
                                                              ]
                                                            },
                                                            "automationKnowledgeGraphId": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "sandboxLifecycle",
                                                            "executionRuntime",
                                                            "workspaceMode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "keyTaskIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "output": {},
                                                        "outputSchema": {}
                                                      },
                                                      "required": [
                                                        "childRunId",
                                                        "childTaskId",
                                                        "finalState",
                                                        "manifestArtifactId",
                                                        "visibleOutputArtifactIds",
                                                        "visibleOutputArtifacts"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "schedule_fire"
                                                    },
                                                    "sourcePayload": {
                                                      "oneOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "scheduleId": {
                                                              "type": "string"
                                                            },
                                                            "deliveryPolicy": {
                                                              "type": "string",
                                                              "const": "latest"
                                                            },
                                                            "firedAt": {
                                                              "type": "string",
                                                              "format": "date-time",
                                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                            },
                                                            "coalescedCount": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "scheduleId",
                                                            "deliveryPolicy",
                                                            "firedAt",
                                                            "coalescedCount"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "scheduleId": {
                                                              "type": "string"
                                                            },
                                                            "deliveryPolicy": {
                                                              "type": "string",
                                                              "const": "all"
                                                            },
                                                            "firedAt": {
                                                              "type": "string",
                                                              "format": "date-time",
                                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                            }
                                                          },
                                                          "required": [
                                                            "scheduleId",
                                                            "deliveryPolicy",
                                                            "firedAt"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "scheduleId": {
                                                              "type": "string"
                                                            },
                                                            "deliveryPolicy": {
                                                              "type": "string",
                                                              "const": "count_only"
                                                            },
                                                            "firstScheduledFor": {
                                                              "type": "string",
                                                              "format": "date-time",
                                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                            },
                                                            "latestScheduledFor": {
                                                              "type": "string",
                                                              "format": "date-time",
                                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                            },
                                                            "missedFireCount": {
                                                              "type": "integer",
                                                              "minimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "scheduleId",
                                                            "deliveryPolicy",
                                                            "firstScheduledFor",
                                                            "latestScheduledFor",
                                                            "missedFireCount"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "external_event"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "eventName": {
                                                          "type": "string"
                                                        },
                                                        "matchKey": {
                                                          "type": "string"
                                                        },
                                                        "producer": {
                                                          "type": "string"
                                                        },
                                                        "occurredAt": {
                                                          "type": "string"
                                                        },
                                                        "data": {}
                                                      },
                                                      "required": [
                                                        "eventName",
                                                        "producer",
                                                        "occurredAt",
                                                        "data"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "cancel_run"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "cancel_wait"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "runWaitId": {
                                                          "type": "string"
                                                        },
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "runWaitId"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "manual_resume"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "wait_timeout"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "runWaitId": {
                                                          "type": "string"
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "runWaitId",
                                                        "deadlineAt"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "recovery_resume"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {},
                                                      "additionalProperties": {}
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "runId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "tenantId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "projectId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "sourceRef": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyKey": {
                                                      "type": "string"
                                                    },
                                                    "transportKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "route",
                                                        "queue",
                                                        "workflow",
                                                        "alarm",
                                                        "internal"
                                                      ]
                                                    },
                                                    "transportMessageId": {
                                                      "type": "string"
                                                    },
                                                    "transport": {},
                                                    "status": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pending",
                                                        "consumed",
                                                        "ignored"
                                                      ]
                                                    },
                                                    "attemptCount": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "lastError": {
                                                      "type": "string"
                                                    },
                                                    "deadLetteredAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "ignoredReason": {
                                                      "type": "string"
                                                    },
                                                    "nextRetryAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "inputArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "consumedByRunTurnId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "receivedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "consumedAt": {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                    },
                                                    "sourceKind": {
                                                      "type": "string",
                                                      "const": "knowledge_event"
                                                    },
                                                    "sourcePayload": {
                                                      "type": "object",
                                                      "properties": {
                                                        "triggerId": {
                                                          "type": "string"
                                                        },
                                                        "triggerName": {
                                                          "type": "string"
                                                        },
                                                        "eventId": {
                                                          "type": "string"
                                                        },
                                                        "knowledgeGraphId": {
                                                          "type": "string"
                                                        },
                                                        "entityKind": {
                                                          "type": "string"
                                                        },
                                                        "nodeId": {
                                                          "type": "string"
                                                        },
                                                        "artifactVersionId": {
                                                          "type": "string"
                                                        },
                                                        "slug": {
                                                          "type": "string"
                                                        },
                                                        "title": {
                                                          "type": "string"
                                                        },
                                                        "changeType": {
                                                          "type": "string",
                                                          "enum": [
                                                            "created",
                                                            "updated",
                                                            "deleted"
                                                          ]
                                                        },
                                                        "causationDepth": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "required": [
                                                        "triggerId",
                                                        "eventId",
                                                        "knowledgeGraphId",
                                                        "slug",
                                                        "changeType",
                                                        "causationDepth"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "runId",
                                                    "tenantId",
                                                    "idempotencyKey",
                                                    "status",
                                                    "attemptCount",
                                                    "receivedAt",
                                                    "sourceKind"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "explanation": {
                                              "type": "string"
                                            },
                                            "resolutionExplanation": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "wait",
                                            "explanation"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "waitGroup",
                                      "waits"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "runState",
                                "groups"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "timeline",
                            "tasks",
                            "artifacts",
                            "costs",
                            "lineage",
                            "waits"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "type": "object",
                          "properties": {
                            "task": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "tool",
                                    "skill",
                                    "human_input",
                                    "child_run",
                                    "external_wait"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "completed",
                                    "failed",
                                    "abandoned",
                                    "skipped",
                                    "cancelled"
                                  ]
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "skillName": {
                                  "type": "string"
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "request": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "toolName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "args": {},
                                        "toolUseId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "toolName",
                                        "args"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "skill"
                                        },
                                        "skillHandle": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "context": {}
                                      },
                                      "required": [
                                        "role",
                                        "skillHandle",
                                        "input"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "approval"
                                            },
                                            "proposedActionSummary": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "approvalSubject": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "skill_activation"
                                                    },
                                                    "skillHandle": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "skillId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "skillVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolUseId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "request": {
                                                      "type": "object",
                                                      "properties": {
                                                        "input": {},
                                                        "artifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "context": {}
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "skillHandle",
                                                    "skillId",
                                                    "request"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "tool_activation"
                                                    },
                                                    "toolName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "connectorId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolUseId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "request": {
                                                      "type": "object",
                                                      "properties": {
                                                        "args": {}
                                                      },
                                                      "required": [
                                                        "args"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "toolName",
                                                    "connectorId",
                                                    "request"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "proposedActionSummary"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "selection"
                                            },
                                            "options": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "description": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "allowMultiple": {
                                              "type": "boolean"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "options"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "responseHint": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "responseSchema": {}
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "responseSchema"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "child_run"
                                        },
                                        "childRunId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {},
                                        "title": {
                                          "type": "string"
                                        },
                                        "runtimeHint": {
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "modelId": {
                                          "type": "string"
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "artifactInputs": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "expectedOutputSchema": {},
                                        "delegationReason": {
                                          "type": "string"
                                        },
                                        "resumePolicy": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "all"
                                                }
                                              },
                                              "required": [
                                                "mode"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "any"
                                                }
                                              },
                                              "required": [
                                                "mode"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "count"
                                                },
                                                "requiredCount": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "mode",
                                                "requiredCount"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "prompt",
                                        "agentId",
                                        "timeoutPolicy"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "external_wait"
                                        },
                                        "eventName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchKey": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string"
                                        },
                                        "expectedPayloadSchema": {},
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "eventName",
                                        "matchKey",
                                        "timeoutPolicy"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "result": {
                                  "oneOf": [
                                    {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "const": "completed"
                                            },
                                            "output": {},
                                            "artifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "const": "waiting"
                                            },
                                            "waitId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "waitGroupId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome",
                                            "waitId",
                                            "waitGroupId"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "enum": [
                                                "failed",
                                                "skipped",
                                                "abandoned",
                                                "cancelled"
                                              ]
                                            },
                                            "reason": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome",
                                            "reason"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "skill"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "completed",
                                            "failed",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "runWaitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "requestTaskId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "responder": {
                                          "type": "object",
                                          "properties": {
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "tenantId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "required": [
                                            "userId",
                                            "tenantId",
                                            "roleIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "respondedAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "decision": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "approved"
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "rejected"
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "selected"
                                                },
                                                "optionIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "optionIds"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "freeform"
                                                },
                                                "text": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "text"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "structured"
                                                },
                                                "value": {}
                                              },
                                              "required": [
                                                "type",
                                                "value"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "runWaitId",
                                        "requestTaskId",
                                        "responder",
                                        "respondedAt",
                                        "decision"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "child_run"
                                        },
                                        "childRunId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "finalState": {
                                          "type": "string",
                                          "enum": [
                                            "closed",
                                            "failed",
                                            "abandoned"
                                          ]
                                        },
                                        "manifestArtifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "visibleOutputArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "visibleOutputArtifacts": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "artifactId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "name": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "type": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "workspacePath": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "contentHash": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "artifactId",
                                              "name",
                                              "type",
                                              "contentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "summary": {
                                          "type": "string"
                                        },
                                        "costCentsUsed": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "tokensUsed": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "runtimePolicyUsed": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "output": {},
                                        "outputSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "childRunId",
                                        "finalState",
                                        "visibleOutputArtifactIds",
                                        "visibleOutputArtifacts"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "external_wait"
                                        },
                                        "eventName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchKey": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "occurredAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "data": {},
                                        "producer": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "eventName",
                                        "matchKey",
                                        "occurredAt",
                                        "data"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "responderId": {
                                  "type": "string"
                                },
                                "claimedByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "claimedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "childRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "groupId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "role",
                                "status",
                                "sequenceNumber",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "depth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "turnNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "operationIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "artifactIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "consumedArtifactIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "waitIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "children": {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          },
                          "required": [
                            "task",
                            "depth",
                            "operationIds",
                            "artifactIds",
                            "consumedArtifactIds",
                            "waitIds",
                            "children"
                          ],
                          "additionalProperties": false
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/tasks": {
      "get": {
        "operationId": "Run_inspectorTasks",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "summary": {
                              "type": "object",
                              "properties": {
                                "totalTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "rootTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "pendingTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runningTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "completedTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "failedTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "claimedTasks": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "totalTasks",
                                "rootTasks",
                                "pendingTasks",
                                "runningTasks",
                                "completedTasks",
                                "failedTasks",
                                "claimedTasks"
                              ],
                              "additionalProperties": false
                            },
                            "roots": {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          },
                          "required": [
                            "summary",
                            "roots"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "type": "object",
                          "properties": {
                            "task": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "role": {
                                  "type": "string",
                                  "enum": [
                                    "tool",
                                    "skill",
                                    "human_input",
                                    "child_run",
                                    "external_wait"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "running",
                                    "completed",
                                    "failed",
                                    "abandoned",
                                    "skipped",
                                    "cancelled"
                                  ]
                                },
                                "sequenceNumber": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "skillName": {
                                  "type": "string"
                                },
                                "skillVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "request": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "toolName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "args": {},
                                        "toolUseId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "toolName",
                                        "args"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "skill"
                                        },
                                        "skillHandle": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "context": {}
                                      },
                                      "required": [
                                        "role",
                                        "skillHandle",
                                        "input"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "approval"
                                            },
                                            "proposedActionSummary": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "approvalSubject": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "skill_activation"
                                                    },
                                                    "skillHandle": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "skillId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "skillVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolUseId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "request": {
                                                      "type": "object",
                                                      "properties": {
                                                        "input": {},
                                                        "artifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "context": {}
                                                      },
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "skillHandle",
                                                    "skillId",
                                                    "request"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "kind": {
                                                      "type": "string",
                                                      "const": "tool_activation"
                                                    },
                                                    "toolName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "connectorId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolUseId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "request": {
                                                      "type": "object",
                                                      "properties": {
                                                        "args": {}
                                                      },
                                                      "required": [
                                                        "args"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  },
                                                  "required": [
                                                    "kind",
                                                    "toolName",
                                                    "connectorId",
                                                    "request"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "proposedActionSummary"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "selection"
                                            },
                                            "options": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "label": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "description": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "label"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "allowMultiple": {
                                              "type": "boolean"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "options"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "responseHint": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "human_input"
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "prompt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "relatedArtifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "allowedResponders": {
                                              "type": "object",
                                              "properties": {
                                                "userIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "roleIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "requestType": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "responseSchema": {}
                                          },
                                          "required": [
                                            "role",
                                            "title",
                                            "prompt",
                                            "relatedArtifactIds",
                                            "allowedResponders",
                                            "timeoutPolicy",
                                            "requestType",
                                            "responseSchema"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "child_run"
                                        },
                                        "childRunId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "agentId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "input": {},
                                        "title": {
                                          "type": "string"
                                        },
                                        "runtimeHint": {
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "modelId": {
                                          "type": "string"
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "artifactInputs": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "expectedOutputSchema": {},
                                        "delegationReason": {
                                          "type": "string"
                                        },
                                        "resumePolicy": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "all"
                                                }
                                              },
                                              "required": [
                                                "mode"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "any"
                                                }
                                              },
                                              "required": [
                                                "mode"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "mode": {
                                                  "type": "string",
                                                  "const": "count"
                                                },
                                                "requiredCount": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "mode",
                                                "requiredCount"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "prompt",
                                        "agentId",
                                        "timeoutPolicy"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "external_wait"
                                        },
                                        "eventName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchKey": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string"
                                        },
                                        "expectedPayloadSchema": {},
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "eventName",
                                        "matchKey",
                                        "timeoutPolicy"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "result": {
                                  "oneOf": [
                                    {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "const": "completed"
                                            },
                                            "output": {},
                                            "artifactIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "const": "waiting"
                                            },
                                            "waitId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "waitGroupId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome",
                                            "waitId",
                                            "waitGroupId"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "role": {
                                              "type": "string",
                                              "const": "tool"
                                            },
                                            "outcome": {
                                              "type": "string",
                                              "enum": [
                                                "failed",
                                                "skipped",
                                                "abandoned",
                                                "cancelled"
                                              ]
                                            },
                                            "reason": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "role",
                                            "outcome",
                                            "reason"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "skill"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "completed",
                                            "failed",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "runWaitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "requestTaskId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "responder": {
                                          "type": "object",
                                          "properties": {
                                            "userId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "tenantId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "required": [
                                            "userId",
                                            "tenantId",
                                            "roleIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "respondedAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "decision": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "approved"
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "rejected"
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "selected"
                                                },
                                                "optionIds": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "note": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "optionIds"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "freeform"
                                                },
                                                "text": {
                                                  "type": "string",
                                                  "minLength": 1
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "text"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "structured"
                                                },
                                                "value": {}
                                              },
                                              "required": [
                                                "type",
                                                "value"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "runWaitId",
                                        "requestTaskId",
                                        "responder",
                                        "respondedAt",
                                        "decision"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "child_run"
                                        },
                                        "childRunId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "finalState": {
                                          "type": "string",
                                          "enum": [
                                            "closed",
                                            "failed",
                                            "abandoned"
                                          ]
                                        },
                                        "manifestArtifactId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "visibleOutputArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "visibleOutputArtifacts": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "artifactId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "name": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "type": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "workspacePath": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "contentHash": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "required": [
                                              "artifactId",
                                              "name",
                                              "type",
                                              "contentHash"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "summary": {
                                          "type": "string"
                                        },
                                        "costCentsUsed": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "tokensUsed": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "runtimePolicyUsed": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "output": {},
                                        "outputSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "childRunId",
                                        "finalState",
                                        "visibleOutputArtifactIds",
                                        "visibleOutputArtifacts"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "external_wait"
                                        },
                                        "eventName": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "matchKey": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "occurredAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "data": {},
                                        "producer": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "eventName",
                                        "matchKey",
                                        "occurredAt",
                                        "data"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                "responderId": {
                                  "type": "string"
                                },
                                "claimedByUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "claimedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "childRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "groupId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "role",
                                "status",
                                "sequenceNumber",
                                "createdAt",
                                "updatedAt"
                              ],
                              "additionalProperties": false
                            },
                            "depth": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "turnNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "operationIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "artifactIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "consumedArtifactIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "waitIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "children": {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          },
                          "required": [
                            "task",
                            "depth",
                            "operationIds",
                            "artifactIds",
                            "consumedArtifactIds",
                            "waitIds",
                            "children"
                          ],
                          "additionalProperties": false
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/artifacts": {
      "get": {
        "operationId": "Run_inspectorArtifacts",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "summary": {
                              "type": "object",
                              "properties": {
                                "totalArtifacts": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "groups": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "visibleOutputs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runLocalStateArtifacts": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "totalArtifacts",
                                "groups",
                                "visibleOutputs",
                                "runLocalStateArtifacts"
                              ],
                              "additionalProperties": false
                            },
                            "groups": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "workspacePath": {
                                    "type": "string"
                                  },
                                  "latestArtifactId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "entries": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "artifact": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runTurnId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "taskId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "operationId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "artifactVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "tenantId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "projectId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "type": {
                                              "type": "string",
                                              "enum": [
                                                "text",
                                                "json",
                                                "image",
                                                "file_reference",
                                                "hitl_decision",
                                                "manifest",
                                                "log_chunk"
                                              ]
                                            },
                                            "visibility": {
                                              "type": "string",
                                              "enum": [
                                                "turn_input",
                                                "task_output",
                                                "run_local_state"
                                              ]
                                            },
                                            "name": {
                                              "type": "string"
                                            },
                                            "content": {
                                              "type": "string"
                                            },
                                            "contentHash": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "mimeType": {
                                              "type": "string"
                                            },
                                            "workspacePath": {
                                              "type": "string"
                                            },
                                            "deleted": {
                                              "type": "boolean"
                                            },
                                            "supersedesRunArtifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "createdAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "runId",
                                            "tenantId",
                                            "type",
                                            "visibility",
                                            "name",
                                            "content",
                                            "mimeType",
                                            "deleted",
                                            "createdAt"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "turnNumber": {
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "producedByOperationId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "producedByTaskId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "consumedByTaskIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "diff": {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "enum": [
                                                "added",
                                                "updated",
                                                "deleted",
                                                "unchanged"
                                              ]
                                            },
                                            "previousArtifactId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "addedLines": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "removedLines": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "summary": {
                                              "type": "string"
                                            },
                                            "beforePreview": {
                                              "type": "string"
                                            },
                                            "afterPreview": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "addedLines",
                                            "removedLines",
                                            "summary"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "artifact",
                                        "consumedByTaskIds",
                                        "diff"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "key",
                                  "label",
                                  "latestArtifactId",
                                  "entries"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "summary",
                            "groups"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/costs": {
      "get": {
        "operationId": "Run_inspectorCosts",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "totals": {
                              "type": "object",
                              "properties": {
                                "operationCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "inputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "outputTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheReadTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "cacheWriteTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "reasoningTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "totalTokens": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "latencyMs": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "operationCount",
                                "inputTokens",
                                "outputTokens",
                                "cacheReadTokens",
                                "cacheWriteTokens",
                                "reasoningTokens",
                                "totalTokens",
                                "costCents",
                                "latencyMs"
                              ],
                              "additionalProperties": false
                            },
                            "counters": {
                              "type": "object",
                              "properties": {
                                "runTokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "operationTokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "tokenDelta": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "runCostCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "operationCostCents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costDeltaCents": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "runTokensUsed",
                                "operationTokensUsed",
                                "tokenDelta",
                                "runCostCentsUsed",
                                "operationCostCents",
                                "costDeltaCents"
                              ],
                              "additionalProperties": false
                            },
                            "childRuns": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "count",
                                "tokensUsed",
                                "costCentsUsed"
                              ],
                              "additionalProperties": false
                            },
                            "byType": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "operationCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "totalTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "key",
                                  "label",
                                  "operationCount",
                                  "inputTokens",
                                  "outputTokens",
                                  "cacheReadTokens",
                                  "cacheWriteTokens",
                                  "reasoningTokens",
                                  "totalTokens",
                                  "costCents",
                                  "latencyMs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "byModel": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "operationCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "totalTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "key",
                                  "label",
                                  "operationCount",
                                  "inputTokens",
                                  "outputTokens",
                                  "cacheReadTokens",
                                  "cacheWriteTokens",
                                  "reasoningTokens",
                                  "totalTokens",
                                  "costCents",
                                  "latencyMs"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "byTurn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "turnId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "turnNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "triggerKind": {
                                    "type": "string",
                                    "enum": [
                                      "initial_start",
                                      "user_message",
                                      "human_response",
                                      "child_run_result",
                                      "schedule_fire",
                                      "external_event",
                                      "cancel_run",
                                      "cancel_wait",
                                      "manual_resume",
                                      "wait_timeout",
                                      "recovery_resume",
                                      "knowledge_event"
                                    ]
                                  },
                                  "model": {
                                    "type": "string"
                                  },
                                  "operationCount": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "inputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "outputTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheReadTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "cacheWriteTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "reasoningTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "totalTokens": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "costCents": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "latencyMs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "turnId",
                                  "turnNumber",
                                  "triggerKind",
                                  "operationCount",
                                  "inputTokens",
                                  "outputTokens",
                                  "cacheReadTokens",
                                  "cacheWriteTokens",
                                  "reasoningTokens",
                                  "totalTokens",
                                  "costCents",
                                  "latencyMs"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "totals",
                            "counters",
                            "childRuns",
                            "byType",
                            "byModel",
                            "byTurn"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/lineage": {
      "get": {
        "operationId": "Run_inspectorLineage",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "counts": {
                              "type": "object",
                              "properties": {
                                "operations": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "skillVersions": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "artifacts": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "operations",
                                "skillVersions",
                                "artifacts"
                              ],
                              "additionalProperties": false
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "Run",
                                      "Operation",
                                      "SkillVersion",
                                      "Artifact"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "subtitle": {
                                    "type": "string"
                                  },
                                  "occurredAt": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  "status": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "kind",
                                  "title"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "enum": [
                                      "ran_operation",
                                      "invoked_skill",
                                      "produced"
                                    ]
                                  },
                                  "fromKind": {
                                    "type": "string",
                                    "enum": [
                                      "Run",
                                      "Operation",
                                      "SkillVersion",
                                      "Artifact"
                                    ]
                                  },
                                  "fromId": {
                                    "type": "string"
                                  },
                                  "toKind": {
                                    "type": "string",
                                    "enum": [
                                      "Run",
                                      "Operation",
                                      "SkillVersion",
                                      "Artifact"
                                    ]
                                  },
                                  "toId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "fromKind",
                                  "fromId",
                                  "toKind",
                                  "toId"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "runId",
                            "counts",
                            "nodes",
                            "edges"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/inspector/waits": {
      "get": {
        "operationId": "Run_inspectorWaits",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "inspector": {
                          "type": "object",
                          "properties": {
                            "runState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "active",
                                "closed",
                                "failed",
                                "abandoned"
                              ]
                            },
                            "whyWaiting": {
                              "type": "string"
                            },
                            "groups": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "waitGroup": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "runId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "tenantId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "projectId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "originatingRunTurnId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "resumePolicy": {
                                        "oneOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "all"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "any"
                                              }
                                            },
                                            "required": [
                                              "mode"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "mode": {
                                                "type": "string",
                                                "const": "count"
                                              },
                                              "requiredCount": {
                                                "type": "integer",
                                                "exclusiveMinimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "mode",
                                              "requiredCount"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "active",
                                          "resolved",
                                          "cancelled",
                                          "timed_out"
                                        ]
                                      },
                                      "createdAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "resolvedAt": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "runId",
                                      "tenantId",
                                      "status",
                                      "createdAt"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "originatingTurnNumber": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "waitingExplanation": {
                                    "type": "string"
                                  },
                                  "resumeExplanation": {
                                    "type": "string"
                                  },
                                  "waits": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "wait": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runWaitGroupId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "tenantId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "projectId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "originatingRunTurnId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "blockingTaskId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "kind": {
                                              "type": "string",
                                              "enum": [
                                                "human_input",
                                                "child_run",
                                                "external_event"
                                              ]
                                            },
                                            "status": {
                                              "type": "string",
                                              "enum": [
                                                "active",
                                                "resolved",
                                                "timed_out",
                                                "cancelled"
                                              ]
                                            },
                                            "expectedTriggerKind": {
                                              "type": "string",
                                              "enum": [
                                                "human_response",
                                                "child_run_result",
                                                "external_event",
                                                "wait_timeout"
                                              ]
                                            },
                                            "sourceRef": {
                                              "type": "string"
                                            },
                                            "childRunId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "deadlineAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "timeoutPolicy": {
                                              "type": "string",
                                              "enum": [
                                                "fail_run",
                                                "resume_with_timeout",
                                                "cancel_run"
                                              ]
                                            },
                                            "resolvedByTriggerDeliveryId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "resolution": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "outcome": {
                                                      "type": "string",
                                                      "const": "resolved"
                                                    },
                                                    "triggerKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "initial_start",
                                                        "user_message",
                                                        "human_response",
                                                        "child_run_result",
                                                        "schedule_fire",
                                                        "external_event",
                                                        "cancel_run",
                                                        "cancel_wait",
                                                        "manual_resume",
                                                        "wait_timeout",
                                                        "recovery_resume",
                                                        "knowledge_event"
                                                      ]
                                                    },
                                                    "payload": {}
                                                  },
                                                  "required": [
                                                    "outcome",
                                                    "triggerKind",
                                                    "payload"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "outcome": {
                                                      "type": "string",
                                                      "const": "timed_out"
                                                    },
                                                    "waitKind": {
                                                      "type": "string",
                                                      "enum": [
                                                        "human_input",
                                                        "child_run",
                                                        "external_event"
                                                      ]
                                                    },
                                                    "deadlineAt": {
                                                      "type": "string"
                                                    },
                                                    "timeoutPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "fail_run",
                                                        "resume_with_timeout",
                                                        "cancel_run"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "outcome",
                                                    "waitKind",
                                                    "deadlineAt",
                                                    "timeoutPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "outcome": {
                                                      "type": "string",
                                                      "const": "cancelled"
                                                    },
                                                    "reason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "outcome"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "createdAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "resolvedAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "runWaitGroupId",
                                            "runId",
                                            "tenantId",
                                            "kind",
                                            "status",
                                            "expectedTriggerKind",
                                            "timeoutPolicy",
                                            "createdAt"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "originatingTurnNumber": {
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "blockingTask": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "runTurnId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "parentTaskId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "tenantId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "projectId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "role": {
                                              "type": "string",
                                              "enum": [
                                                "tool",
                                                "skill",
                                                "human_input",
                                                "child_run",
                                                "external_wait"
                                              ]
                                            },
                                            "status": {
                                              "type": "string",
                                              "enum": [
                                                "pending",
                                                "running",
                                                "completed",
                                                "failed",
                                                "abandoned",
                                                "skipped",
                                                "cancelled"
                                              ]
                                            },
                                            "sequenceNumber": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "skillName": {
                                              "type": "string"
                                            },
                                            "skillVersionId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "input": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string"
                                              },
                                              "additionalProperties": {}
                                            },
                                            "request": {
                                              "oneOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "tool"
                                                    },
                                                    "toolName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "args": {},
                                                    "toolUseId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "toolName",
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "skill"
                                                    },
                                                    "skillHandle": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "required": [
                                                    "role",
                                                    "skillHandle",
                                                    "input"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "oneOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "human_input"
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "relatedArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "allowedResponders": {
                                                          "type": "object",
                                                          "properties": {
                                                            "userIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "roleIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        },
                                                        "requestType": {
                                                          "type": "string",
                                                          "const": "approval"
                                                        },
                                                        "proposedActionSummary": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "approvalSubject": {
                                                          "oneOf": [
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "kind": {
                                                                  "type": "string",
                                                                  "const": "skill_activation"
                                                                },
                                                                "skillHandle": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "skillId": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "skillVersionId": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "toolUseId": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "request": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "input": {},
                                                                    "artifactIds": {
                                                                      "type": "array",
                                                                      "items": {
                                                                        "type": "string",
                                                                        "minLength": 1
                                                                      }
                                                                    },
                                                                    "context": {}
                                                                  },
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "kind",
                                                                "skillHandle",
                                                                "skillId",
                                                                "request"
                                                              ],
                                                              "additionalProperties": false
                                                            },
                                                            {
                                                              "type": "object",
                                                              "properties": {
                                                                "kind": {
                                                                  "type": "string",
                                                                  "const": "tool_activation"
                                                                },
                                                                "toolName": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "connectorId": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "toolUseId": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                },
                                                                "request": {
                                                                  "type": "object",
                                                                  "properties": {
                                                                    "args": {}
                                                                  },
                                                                  "required": [
                                                                    "args"
                                                                  ],
                                                                  "additionalProperties": false
                                                                }
                                                              },
                                                              "required": [
                                                                "kind",
                                                                "toolName",
                                                                "connectorId",
                                                                "request"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "title",
                                                        "prompt",
                                                        "relatedArtifactIds",
                                                        "allowedResponders",
                                                        "timeoutPolicy",
                                                        "requestType",
                                                        "proposedActionSummary"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "human_input"
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "relatedArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "allowedResponders": {
                                                          "type": "object",
                                                          "properties": {
                                                            "userIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "roleIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        },
                                                        "requestType": {
                                                          "type": "string",
                                                          "const": "selection"
                                                        },
                                                        "options": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "label"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "allowMultiple": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "title",
                                                        "prompt",
                                                        "relatedArtifactIds",
                                                        "allowedResponders",
                                                        "timeoutPolicy",
                                                        "requestType",
                                                        "options"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "human_input"
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "relatedArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "allowedResponders": {
                                                          "type": "object",
                                                          "properties": {
                                                            "userIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "roleIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        },
                                                        "requestType": {
                                                          "type": "string",
                                                          "const": "freeform"
                                                        },
                                                        "responseHint": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "title",
                                                        "prompt",
                                                        "relatedArtifactIds",
                                                        "allowedResponders",
                                                        "timeoutPolicy",
                                                        "requestType"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "human_input"
                                                        },
                                                        "title": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "prompt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "relatedArtifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "allowedResponders": {
                                                          "type": "object",
                                                          "properties": {
                                                            "userIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "roleIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        "deadlineAt": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "timeoutPolicy": {
                                                          "type": "string",
                                                          "enum": [
                                                            "fail_run",
                                                            "resume_with_timeout",
                                                            "cancel_run"
                                                          ]
                                                        },
                                                        "requestType": {
                                                          "type": "string",
                                                          "const": "structured"
                                                        },
                                                        "responseSchema": {}
                                                      },
                                                      "required": [
                                                        "role",
                                                        "title",
                                                        "prompt",
                                                        "relatedArtifactIds",
                                                        "allowedResponders",
                                                        "timeoutPolicy",
                                                        "requestType",
                                                        "responseSchema"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "child_run"
                                                    },
                                                    "childRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "prompt": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "agentId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "input": {},
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "runtimeHint": {
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "modelId": {
                                                      "type": "string"
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "artifactInputs": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "expectedOutputSchema": {},
                                                    "delegationReason": {
                                                      "type": "string"
                                                    },
                                                    "resumePolicy": {
                                                      "oneOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "mode": {
                                                              "type": "string",
                                                              "const": "all"
                                                            }
                                                          },
                                                          "required": [
                                                            "mode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "mode": {
                                                              "type": "string",
                                                              "const": "any"
                                                            }
                                                          },
                                                          "required": [
                                                            "mode"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "mode": {
                                                              "type": "string",
                                                              "const": "count"
                                                            },
                                                            "requiredCount": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "mode",
                                                            "requiredCount"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    },
                                                    "deadlineAt": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "timeoutPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "fail_run",
                                                        "resume_with_timeout",
                                                        "cancel_run"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "prompt",
                                                    "agentId",
                                                    "timeoutPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "external_wait"
                                                    },
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "prompt": {
                                                      "type": "string"
                                                    },
                                                    "expectedPayloadSchema": {},
                                                    "deadlineAt": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "timeoutPolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "fail_run",
                                                        "resume_with_timeout",
                                                        "cancel_run"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "eventName",
                                                    "matchKey",
                                                    "timeoutPolicy"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "result": {
                                              "oneOf": [
                                                {
                                                  "oneOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "tool"
                                                        },
                                                        "outcome": {
                                                          "type": "string",
                                                          "const": "completed"
                                                        },
                                                        "output": {},
                                                        "artifactIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "outcome"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "tool"
                                                        },
                                                        "outcome": {
                                                          "type": "string",
                                                          "const": "waiting"
                                                        },
                                                        "waitId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "waitGroupId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "outcome",
                                                        "waitId",
                                                        "waitGroupId"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "role": {
                                                          "type": "string",
                                                          "const": "tool"
                                                        },
                                                        "outcome": {
                                                          "type": "string",
                                                          "enum": [
                                                            "failed",
                                                            "skipped",
                                                            "abandoned",
                                                            "cancelled"
                                                          ]
                                                        },
                                                        "reason": {
                                                          "type": "string"
                                                        }
                                                      },
                                                      "required": [
                                                        "role",
                                                        "outcome",
                                                        "reason"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "skill"
                                                    },
                                                    "outcome": {
                                                      "type": "string",
                                                      "enum": [
                                                        "completed",
                                                        "failed",
                                                        "abandoned",
                                                        "cancelled"
                                                      ]
                                                    },
                                                    "output": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "reason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "outcome"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "human_input"
                                                    },
                                                    "runWaitId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "requestTaskId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "responder": {
                                                      "type": "object",
                                                      "properties": {
                                                        "userId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "tenantId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "roleIds": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "userId",
                                                        "tenantId",
                                                        "roleIds"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "respondedAt": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "decision": {
                                                      "oneOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "type": {
                                                              "type": "string",
                                                              "const": "approved"
                                                            },
                                                            "note": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "type"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "type": {
                                                              "type": "string",
                                                              "const": "rejected"
                                                            },
                                                            "note": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "type"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "type": {
                                                              "type": "string",
                                                              "const": "selected"
                                                            },
                                                            "optionIds": {
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "note": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "type",
                                                            "optionIds"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "type": {
                                                              "type": "string",
                                                              "const": "freeform"
                                                            },
                                                            "text": {
                                                              "type": "string",
                                                              "minLength": 1
                                                            }
                                                          },
                                                          "required": [
                                                            "type",
                                                            "text"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "type": {
                                                              "type": "string",
                                                              "const": "structured"
                                                            },
                                                            "value": {}
                                                          },
                                                          "required": [
                                                            "type",
                                                            "value"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "runWaitId",
                                                    "requestTaskId",
                                                    "responder",
                                                    "respondedAt",
                                                    "decision"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "child_run"
                                                    },
                                                    "childRunId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "finalState": {
                                                      "type": "string",
                                                      "enum": [
                                                        "closed",
                                                        "failed",
                                                        "abandoned"
                                                      ]
                                                    },
                                                    "manifestArtifactId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "visibleOutputArtifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "visibleOutputArtifacts": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "name": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "type": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "workspacePath": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "contentHash": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "name",
                                                          "type",
                                                          "contentHash"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "runtimePolicyUsed": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "output": {},
                                                    "outputSchema": {}
                                                  },
                                                  "required": [
                                                    "role",
                                                    "childRunId",
                                                    "finalState",
                                                    "visibleOutputArtifactIds",
                                                    "visibleOutputArtifacts"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "const": "external_wait"
                                                    },
                                                    "eventName": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "matchKey": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "occurredAt": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "data": {},
                                                    "producer": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "eventName",
                                                    "matchKey",
                                                    "occurredAt",
                                                    "data"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              ]
                                            },
                                            "responderId": {
                                              "type": "string"
                                            },
                                            "claimedByUserId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "claimedAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "childRunId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "groupId": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "expiresAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "createdAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "updatedAt": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "runId",
                                            "tenantId",
                                            "role",
                                            "status",
                                            "sequenceNumber",
                                            "createdAt",
                                            "updatedAt"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "childRun": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "actorKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human",
                                                    "agent"
                                                  ]
                                                },
                                                "actorId": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  ]
                                                },
                                                "parentRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "conversationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "triggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "evalRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "replayOfRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "goalId": {
                                                  "type": "string"
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "messageCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "closePolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "explicit",
                                                    "auto_on_idle",
                                                    "auto_on_parent_delivery"
                                                  ]
                                                },
                                                "wakePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "manual": {
                                                      "type": "boolean"
                                                    },
                                                    "schedules": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "cron": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "deliveryPolicy": {
                                                            "type": "string",
                                                            "enum": [
                                                              "latest",
                                                              "all",
                                                              "count_only"
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "cron",
                                                          "deliveryPolicy"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "events": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "eventName": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "matchKey": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "eventName"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "manual",
                                                    "schedules",
                                                    "events"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "resourcePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "behavioral": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    },
                                                    "reference": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "behavioral",
                                                    "reference"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "runtimePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "sandboxLifecycle": {
                                                      "type": "string",
                                                      "enum": [
                                                        "ephemeral_per_turn",
                                                        "snapshot_to_r2",
                                                        "warm_per_run"
                                                      ]
                                                    },
                                                    "executionRuntime": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceMode": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "directToolPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "workspaceWritePrefixes": {
                                                          "maxItems": 100,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "destructiveCommands": {
                                                          "default": "allow",
                                                          "type": "string",
                                                          "enum": [
                                                            "allow",
                                                            "deny"
                                                          ]
                                                        },
                                                        "codemode": {
                                                          "type": "object",
                                                          "properties": {
                                                            "enabled": {
                                                              "default": true,
                                                              "type": "boolean"
                                                            },
                                                            "minEligibleTools": {
                                                              "default": 5,
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 1000
                                                            },
                                                            "timeoutMs": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "enabled",
                                                            "minEligibleTools"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      },
                                                      "required": [
                                                        "destructiveCommands"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "automationTest": {
                                                      "type": "boolean"
                                                    },
                                                    "automationRun": {
                                                      "type": "boolean"
                                                    },
                                                    "automationBrainAccess": {
                                                      "type": "string",
                                                      "enum": [
                                                        "read_only",
                                                        "read_write"
                                                      ]
                                                    },
                                                    "automationKnowledgeGraphId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "sandboxLifecycle",
                                                    "executionRuntime",
                                                    "workspaceMode"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "budgetPolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "maxTokensPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxTokensPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "tokensUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "costCentsUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "behaviorSnapshot": {
                                                  "type": "object",
                                                  "properties": {
                                                    "agentPromptVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "pinnedSkills": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "skillVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "executionMode": {
                                                            "type": "string",
                                                            "enum": [
                                                              "prompt",
                                                              "code"
                                                            ]
                                                          },
                                                          "allowedTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "body": {
                                                            "type": "string"
                                                          },
                                                          "bundleRef": {
                                                            "type": "string"
                                                          },
                                                          "bundleHash": {
                                                            "type": "string"
                                                          },
                                                          "metadata": {}
                                                        },
                                                        "required": [
                                                          "skillVersionId",
                                                          "executionMode",
                                                          "metadata"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "skillPolicies": {},
                                                    "model": {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "provider": {
                                                          "type": "string"
                                                        },
                                                        "params": {},
                                                        "temperature": {
                                                          "type": "number",
                                                          "minimum": 0,
                                                          "maximum": 2
                                                        },
                                                        "reasoning": {
                                                          "type": "string",
                                                          "enum": [
                                                            "off",
                                                            "low",
                                                            "medium",
                                                            "high",
                                                            "xhigh",
                                                            "max"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "params"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "modelRoutingPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptTemplate": {
                                                      "type": "string"
                                                    },
                                                    "systemPromptTemplateHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolCatalogHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "harness": {
                                                      "type": "object",
                                                      "properties": {
                                                        "version": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "scoringVersion": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "version",
                                                        "scoringVersion"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "goalVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "corpusVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "outputSchema": {},
                                                    "packId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packBindings": {
                                                      "default": [],
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "requirementKey": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "packBindingId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "targetKind": {
                                                            "type": "string",
                                                            "enum": [
                                                              "connector",
                                                              "corpus"
                                                            ]
                                                          },
                                                          "targetId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "enabledTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "policyOverrides": {}
                                                        },
                                                        "required": [
                                                          "requirementKey",
                                                          "packBindingId",
                                                          "targetKind",
                                                          "targetId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "pinnedSkills",
                                                    "skillPolicies",
                                                    "model",
                                                    "systemPromptTemplate",
                                                    "systemPromptTemplateHash",
                                                    "toolCatalogHash",
                                                    "harness",
                                                    "closePolicy",
                                                    "wakePolicy",
                                                    "resourcePolicy",
                                                    "runtimePolicy",
                                                    "budgetPolicy",
                                                    "packBindings"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "shareToken": {
                                                  "type": "string"
                                                },
                                                "shareExpiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "artifactInputs": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "artifactId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "artifactVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "required": [
                                                      "artifactId",
                                                      "artifactVersionId"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "pinnedVersions": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "waitingOnUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceBranchId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceOwnershipKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto_created",
                                                    "user_specified",
                                                    "inherited_from_parent"
                                                  ]
                                                },
                                                "executionRuntimeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "fast_virtual",
                                                    "dynamic_worker",
                                                    "required_full_os"
                                                  ]
                                                },
                                                "workspaceModeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "persistent"
                                                  ]
                                                },
                                                "archivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "deletedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "state": {
                                                  "type": "string",
                                                  "const": "pending"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "tenantId",
                                                "title",
                                                "actorKind",
                                                "actorId",
                                                "messageCount",
                                                "tokensUsed",
                                                "costCentsUsed",
                                                "executionRuntimeDerived",
                                                "workspaceModeDerived",
                                                "createdAt",
                                                "updatedAt",
                                                "state"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "actorKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human",
                                                    "agent"
                                                  ]
                                                },
                                                "actorId": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  ]
                                                },
                                                "parentRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "conversationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "triggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "evalRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "replayOfRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "goalId": {
                                                  "type": "string"
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "messageCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "closePolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "explicit",
                                                    "auto_on_idle",
                                                    "auto_on_parent_delivery"
                                                  ]
                                                },
                                                "wakePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "manual": {
                                                      "type": "boolean"
                                                    },
                                                    "schedules": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "cron": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "deliveryPolicy": {
                                                            "type": "string",
                                                            "enum": [
                                                              "latest",
                                                              "all",
                                                              "count_only"
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "cron",
                                                          "deliveryPolicy"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "events": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "eventName": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "matchKey": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "eventName"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "manual",
                                                    "schedules",
                                                    "events"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "resourcePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "behavioral": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    },
                                                    "reference": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "behavioral",
                                                    "reference"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "runtimePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "sandboxLifecycle": {
                                                      "type": "string",
                                                      "enum": [
                                                        "ephemeral_per_turn",
                                                        "snapshot_to_r2",
                                                        "warm_per_run"
                                                      ]
                                                    },
                                                    "executionRuntime": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceMode": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "directToolPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "workspaceWritePrefixes": {
                                                          "maxItems": 100,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "destructiveCommands": {
                                                          "default": "allow",
                                                          "type": "string",
                                                          "enum": [
                                                            "allow",
                                                            "deny"
                                                          ]
                                                        },
                                                        "codemode": {
                                                          "type": "object",
                                                          "properties": {
                                                            "enabled": {
                                                              "default": true,
                                                              "type": "boolean"
                                                            },
                                                            "minEligibleTools": {
                                                              "default": 5,
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 1000
                                                            },
                                                            "timeoutMs": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "enabled",
                                                            "minEligibleTools"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      },
                                                      "required": [
                                                        "destructiveCommands"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "automationTest": {
                                                      "type": "boolean"
                                                    },
                                                    "automationRun": {
                                                      "type": "boolean"
                                                    },
                                                    "automationBrainAccess": {
                                                      "type": "string",
                                                      "enum": [
                                                        "read_only",
                                                        "read_write"
                                                      ]
                                                    },
                                                    "automationKnowledgeGraphId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "sandboxLifecycle",
                                                    "executionRuntime",
                                                    "workspaceMode"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "budgetPolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "maxTokensPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxTokensPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "tokensUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "costCentsUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "behaviorSnapshot": {
                                                  "type": "object",
                                                  "properties": {
                                                    "agentPromptVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "pinnedSkills": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "skillVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "executionMode": {
                                                            "type": "string",
                                                            "enum": [
                                                              "prompt",
                                                              "code"
                                                            ]
                                                          },
                                                          "allowedTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "body": {
                                                            "type": "string"
                                                          },
                                                          "bundleRef": {
                                                            "type": "string"
                                                          },
                                                          "bundleHash": {
                                                            "type": "string"
                                                          },
                                                          "metadata": {}
                                                        },
                                                        "required": [
                                                          "skillVersionId",
                                                          "executionMode",
                                                          "metadata"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "skillPolicies": {},
                                                    "model": {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "provider": {
                                                          "type": "string"
                                                        },
                                                        "params": {},
                                                        "temperature": {
                                                          "type": "number",
                                                          "minimum": 0,
                                                          "maximum": 2
                                                        },
                                                        "reasoning": {
                                                          "type": "string",
                                                          "enum": [
                                                            "off",
                                                            "low",
                                                            "medium",
                                                            "high",
                                                            "xhigh",
                                                            "max"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "params"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "modelRoutingPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptTemplate": {
                                                      "type": "string"
                                                    },
                                                    "systemPromptTemplateHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolCatalogHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "harness": {
                                                      "type": "object",
                                                      "properties": {
                                                        "version": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "scoringVersion": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "version",
                                                        "scoringVersion"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "goalVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "corpusVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "outputSchema": {},
                                                    "packId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packBindings": {
                                                      "default": [],
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "requirementKey": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "packBindingId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "targetKind": {
                                                            "type": "string",
                                                            "enum": [
                                                              "connector",
                                                              "corpus"
                                                            ]
                                                          },
                                                          "targetId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "enabledTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "policyOverrides": {}
                                                        },
                                                        "required": [
                                                          "requirementKey",
                                                          "packBindingId",
                                                          "targetKind",
                                                          "targetId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "pinnedSkills",
                                                    "skillPolicies",
                                                    "model",
                                                    "systemPromptTemplate",
                                                    "systemPromptTemplateHash",
                                                    "toolCatalogHash",
                                                    "harness",
                                                    "closePolicy",
                                                    "wakePolicy",
                                                    "resourcePolicy",
                                                    "runtimePolicy",
                                                    "budgetPolicy",
                                                    "packBindings"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "shareToken": {
                                                  "type": "string"
                                                },
                                                "shareExpiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "artifactInputs": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "artifactId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "artifactVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "required": [
                                                      "artifactId",
                                                      "artifactVersionId"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "pinnedVersions": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "waitingOnUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceBranchId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceOwnershipKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto_created",
                                                    "user_specified",
                                                    "inherited_from_parent"
                                                  ]
                                                },
                                                "executionRuntimeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "fast_virtual",
                                                    "dynamic_worker",
                                                    "required_full_os"
                                                  ]
                                                },
                                                "workspaceModeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "persistent"
                                                  ]
                                                },
                                                "archivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "deletedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "state": {
                                                  "type": "string",
                                                  "const": "active"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "tenantId",
                                                "title",
                                                "actorKind",
                                                "actorId",
                                                "messageCount",
                                                "tokensUsed",
                                                "costCentsUsed",
                                                "executionRuntimeDerived",
                                                "workspaceModeDerived",
                                                "createdAt",
                                                "updatedAt",
                                                "state"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "actorKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human",
                                                    "agent"
                                                  ]
                                                },
                                                "actorId": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  ]
                                                },
                                                "parentRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "conversationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "triggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "evalRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "replayOfRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "goalId": {
                                                  "type": "string"
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "messageCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "closePolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "explicit",
                                                    "auto_on_idle",
                                                    "auto_on_parent_delivery"
                                                  ]
                                                },
                                                "wakePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "manual": {
                                                      "type": "boolean"
                                                    },
                                                    "schedules": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "cron": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "deliveryPolicy": {
                                                            "type": "string",
                                                            "enum": [
                                                              "latest",
                                                              "all",
                                                              "count_only"
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "cron",
                                                          "deliveryPolicy"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "events": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "eventName": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "matchKey": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "eventName"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "manual",
                                                    "schedules",
                                                    "events"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "resourcePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "behavioral": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    },
                                                    "reference": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "behavioral",
                                                    "reference"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "runtimePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "sandboxLifecycle": {
                                                      "type": "string",
                                                      "enum": [
                                                        "ephemeral_per_turn",
                                                        "snapshot_to_r2",
                                                        "warm_per_run"
                                                      ]
                                                    },
                                                    "executionRuntime": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceMode": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "directToolPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "workspaceWritePrefixes": {
                                                          "maxItems": 100,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "destructiveCommands": {
                                                          "default": "allow",
                                                          "type": "string",
                                                          "enum": [
                                                            "allow",
                                                            "deny"
                                                          ]
                                                        },
                                                        "codemode": {
                                                          "type": "object",
                                                          "properties": {
                                                            "enabled": {
                                                              "default": true,
                                                              "type": "boolean"
                                                            },
                                                            "minEligibleTools": {
                                                              "default": 5,
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 1000
                                                            },
                                                            "timeoutMs": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "enabled",
                                                            "minEligibleTools"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      },
                                                      "required": [
                                                        "destructiveCommands"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "automationTest": {
                                                      "type": "boolean"
                                                    },
                                                    "automationRun": {
                                                      "type": "boolean"
                                                    },
                                                    "automationBrainAccess": {
                                                      "type": "string",
                                                      "enum": [
                                                        "read_only",
                                                        "read_write"
                                                      ]
                                                    },
                                                    "automationKnowledgeGraphId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "sandboxLifecycle",
                                                    "executionRuntime",
                                                    "workspaceMode"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "budgetPolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "maxTokensPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxTokensPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "tokensUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "costCentsUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "behaviorSnapshot": {
                                                  "type": "object",
                                                  "properties": {
                                                    "agentPromptVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "pinnedSkills": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "skillVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "executionMode": {
                                                            "type": "string",
                                                            "enum": [
                                                              "prompt",
                                                              "code"
                                                            ]
                                                          },
                                                          "allowedTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "body": {
                                                            "type": "string"
                                                          },
                                                          "bundleRef": {
                                                            "type": "string"
                                                          },
                                                          "bundleHash": {
                                                            "type": "string"
                                                          },
                                                          "metadata": {}
                                                        },
                                                        "required": [
                                                          "skillVersionId",
                                                          "executionMode",
                                                          "metadata"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "skillPolicies": {},
                                                    "model": {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "provider": {
                                                          "type": "string"
                                                        },
                                                        "params": {},
                                                        "temperature": {
                                                          "type": "number",
                                                          "minimum": 0,
                                                          "maximum": 2
                                                        },
                                                        "reasoning": {
                                                          "type": "string",
                                                          "enum": [
                                                            "off",
                                                            "low",
                                                            "medium",
                                                            "high",
                                                            "xhigh",
                                                            "max"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "params"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "modelRoutingPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptTemplate": {
                                                      "type": "string"
                                                    },
                                                    "systemPromptTemplateHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolCatalogHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "harness": {
                                                      "type": "object",
                                                      "properties": {
                                                        "version": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "scoringVersion": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "version",
                                                        "scoringVersion"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "goalVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "corpusVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "outputSchema": {},
                                                    "packId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packBindings": {
                                                      "default": [],
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "requirementKey": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "packBindingId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "targetKind": {
                                                            "type": "string",
                                                            "enum": [
                                                              "connector",
                                                              "corpus"
                                                            ]
                                                          },
                                                          "targetId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "enabledTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "policyOverrides": {}
                                                        },
                                                        "required": [
                                                          "requirementKey",
                                                          "packBindingId",
                                                          "targetKind",
                                                          "targetId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "pinnedSkills",
                                                    "skillPolicies",
                                                    "model",
                                                    "systemPromptTemplate",
                                                    "systemPromptTemplateHash",
                                                    "toolCatalogHash",
                                                    "harness",
                                                    "closePolicy",
                                                    "wakePolicy",
                                                    "resourcePolicy",
                                                    "runtimePolicy",
                                                    "budgetPolicy",
                                                    "packBindings"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "shareToken": {
                                                  "type": "string"
                                                },
                                                "shareExpiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "artifactInputs": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "artifactId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "artifactVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "required": [
                                                      "artifactId",
                                                      "artifactVersionId"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "pinnedVersions": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "waitingOnUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceBranchId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceOwnershipKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto_created",
                                                    "user_specified",
                                                    "inherited_from_parent"
                                                  ]
                                                },
                                                "executionRuntimeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "fast_virtual",
                                                    "dynamic_worker",
                                                    "required_full_os"
                                                  ]
                                                },
                                                "workspaceModeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "persistent"
                                                  ]
                                                },
                                                "archivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "deletedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "state": {
                                                  "type": "string",
                                                  "const": "closed"
                                                },
                                                "output": {}
                                              },
                                              "required": [
                                                "id",
                                                "tenantId",
                                                "title",
                                                "actorKind",
                                                "actorId",
                                                "messageCount",
                                                "tokensUsed",
                                                "costCentsUsed",
                                                "executionRuntimeDerived",
                                                "workspaceModeDerived",
                                                "createdAt",
                                                "updatedAt",
                                                "state"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "actorKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human",
                                                    "agent"
                                                  ]
                                                },
                                                "actorId": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  ]
                                                },
                                                "parentRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "conversationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "triggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "evalRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "replayOfRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "goalId": {
                                                  "type": "string"
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "messageCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "closePolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "explicit",
                                                    "auto_on_idle",
                                                    "auto_on_parent_delivery"
                                                  ]
                                                },
                                                "wakePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "manual": {
                                                      "type": "boolean"
                                                    },
                                                    "schedules": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "cron": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "deliveryPolicy": {
                                                            "type": "string",
                                                            "enum": [
                                                              "latest",
                                                              "all",
                                                              "count_only"
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "cron",
                                                          "deliveryPolicy"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "events": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "eventName": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "matchKey": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "eventName"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "manual",
                                                    "schedules",
                                                    "events"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "resourcePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "behavioral": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    },
                                                    "reference": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "behavioral",
                                                    "reference"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "runtimePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "sandboxLifecycle": {
                                                      "type": "string",
                                                      "enum": [
                                                        "ephemeral_per_turn",
                                                        "snapshot_to_r2",
                                                        "warm_per_run"
                                                      ]
                                                    },
                                                    "executionRuntime": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceMode": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "directToolPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "workspaceWritePrefixes": {
                                                          "maxItems": 100,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "destructiveCommands": {
                                                          "default": "allow",
                                                          "type": "string",
                                                          "enum": [
                                                            "allow",
                                                            "deny"
                                                          ]
                                                        },
                                                        "codemode": {
                                                          "type": "object",
                                                          "properties": {
                                                            "enabled": {
                                                              "default": true,
                                                              "type": "boolean"
                                                            },
                                                            "minEligibleTools": {
                                                              "default": 5,
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 1000
                                                            },
                                                            "timeoutMs": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "enabled",
                                                            "minEligibleTools"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      },
                                                      "required": [
                                                        "destructiveCommands"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "automationTest": {
                                                      "type": "boolean"
                                                    },
                                                    "automationRun": {
                                                      "type": "boolean"
                                                    },
                                                    "automationBrainAccess": {
                                                      "type": "string",
                                                      "enum": [
                                                        "read_only",
                                                        "read_write"
                                                      ]
                                                    },
                                                    "automationKnowledgeGraphId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "sandboxLifecycle",
                                                    "executionRuntime",
                                                    "workspaceMode"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "budgetPolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "maxTokensPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxTokensPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "tokensUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "costCentsUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "behaviorSnapshot": {
                                                  "type": "object",
                                                  "properties": {
                                                    "agentPromptVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "pinnedSkills": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "skillVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "executionMode": {
                                                            "type": "string",
                                                            "enum": [
                                                              "prompt",
                                                              "code"
                                                            ]
                                                          },
                                                          "allowedTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "body": {
                                                            "type": "string"
                                                          },
                                                          "bundleRef": {
                                                            "type": "string"
                                                          },
                                                          "bundleHash": {
                                                            "type": "string"
                                                          },
                                                          "metadata": {}
                                                        },
                                                        "required": [
                                                          "skillVersionId",
                                                          "executionMode",
                                                          "metadata"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "skillPolicies": {},
                                                    "model": {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "provider": {
                                                          "type": "string"
                                                        },
                                                        "params": {},
                                                        "temperature": {
                                                          "type": "number",
                                                          "minimum": 0,
                                                          "maximum": 2
                                                        },
                                                        "reasoning": {
                                                          "type": "string",
                                                          "enum": [
                                                            "off",
                                                            "low",
                                                            "medium",
                                                            "high",
                                                            "xhigh",
                                                            "max"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "params"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "modelRoutingPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptTemplate": {
                                                      "type": "string"
                                                    },
                                                    "systemPromptTemplateHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolCatalogHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "harness": {
                                                      "type": "object",
                                                      "properties": {
                                                        "version": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "scoringVersion": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "version",
                                                        "scoringVersion"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "goalVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "corpusVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "outputSchema": {},
                                                    "packId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packBindings": {
                                                      "default": [],
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "requirementKey": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "packBindingId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "targetKind": {
                                                            "type": "string",
                                                            "enum": [
                                                              "connector",
                                                              "corpus"
                                                            ]
                                                          },
                                                          "targetId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "enabledTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "policyOverrides": {}
                                                        },
                                                        "required": [
                                                          "requirementKey",
                                                          "packBindingId",
                                                          "targetKind",
                                                          "targetId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "pinnedSkills",
                                                    "skillPolicies",
                                                    "model",
                                                    "systemPromptTemplate",
                                                    "systemPromptTemplateHash",
                                                    "toolCatalogHash",
                                                    "harness",
                                                    "closePolicy",
                                                    "wakePolicy",
                                                    "resourcePolicy",
                                                    "runtimePolicy",
                                                    "budgetPolicy",
                                                    "packBindings"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "shareToken": {
                                                  "type": "string"
                                                },
                                                "shareExpiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "artifactInputs": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "artifactId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "artifactVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "required": [
                                                      "artifactId",
                                                      "artifactVersionId"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "pinnedVersions": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "waitingOnUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceBranchId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceOwnershipKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto_created",
                                                    "user_specified",
                                                    "inherited_from_parent"
                                                  ]
                                                },
                                                "executionRuntimeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "fast_virtual",
                                                    "dynamic_worker",
                                                    "required_full_os"
                                                  ]
                                                },
                                                "workspaceModeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "persistent"
                                                  ]
                                                },
                                                "archivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "deletedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "state": {
                                                  "type": "string",
                                                  "const": "failed"
                                                },
                                                "failureReason": {
                                                  "type": "string"
                                                },
                                                "failureCategory": {
                                                  "type": "string",
                                                  "enum": [
                                                    "provider_error",
                                                    "invariant_violation",
                                                    "unhandled_exception",
                                                    "dependency_unavailable"
                                                  ]
                                                },
                                                "failureDetail": {}
                                              },
                                              "required": [
                                                "id",
                                                "tenantId",
                                                "title",
                                                "actorKind",
                                                "actorId",
                                                "messageCount",
                                                "tokensUsed",
                                                "costCentsUsed",
                                                "executionRuntimeDerived",
                                                "workspaceModeDerived",
                                                "createdAt",
                                                "updatedAt",
                                                "state",
                                                "failureReason",
                                                "failureCategory"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "summary": {
                                                  "type": "string"
                                                },
                                                "actorKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "human",
                                                    "agent"
                                                  ]
                                                },
                                                "actorId": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  ]
                                                },
                                                "parentRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "parentTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "spawnedByTaskId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "conversationId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "triggerDeliveryId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "evalRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "replayOfRunId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "goalId": {
                                                  "type": "string"
                                                },
                                                "input": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {}
                                                },
                                                "messageCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "closePolicy": {
                                                  "type": "string",
                                                  "enum": [
                                                    "explicit",
                                                    "auto_on_idle",
                                                    "auto_on_parent_delivery"
                                                  ]
                                                },
                                                "wakePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "manual": {
                                                      "type": "boolean"
                                                    },
                                                    "schedules": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "id": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "cron": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "deliveryPolicy": {
                                                            "type": "string",
                                                            "enum": [
                                                              "latest",
                                                              "all",
                                                              "count_only"
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "id",
                                                          "cron",
                                                          "deliveryPolicy"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "events": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "eventName": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "matchKey": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "eventName"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "manual",
                                                    "schedules",
                                                    "events"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "resourcePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "behavioral": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    },
                                                    "reference": {
                                                      "type": "string",
                                                      "enum": [
                                                        "pin_on_run_start",
                                                        "follow_latest_on_turn_start"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "behavioral",
                                                    "reference"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "runtimePolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "sandboxLifecycle": {
                                                      "type": "string",
                                                      "enum": [
                                                        "ephemeral_per_turn",
                                                        "snapshot_to_r2",
                                                        "warm_per_run"
                                                      ]
                                                    },
                                                    "executionRuntime": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "fast_virtual",
                                                        "dynamic_worker",
                                                        "required_full_os"
                                                      ]
                                                    },
                                                    "workspaceMode": {
                                                      "default": "none",
                                                      "type": "string",
                                                      "enum": [
                                                        "none",
                                                        "persistent"
                                                      ]
                                                    },
                                                    "directToolPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "workspaceWritePrefixes": {
                                                          "maxItems": 100,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          }
                                                        },
                                                        "destructiveCommands": {
                                                          "default": "allow",
                                                          "type": "string",
                                                          "enum": [
                                                            "allow",
                                                            "deny"
                                                          ]
                                                        },
                                                        "codemode": {
                                                          "type": "object",
                                                          "properties": {
                                                            "enabled": {
                                                              "default": true,
                                                              "type": "boolean"
                                                            },
                                                            "minEligibleTools": {
                                                              "default": 5,
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 1000
                                                            },
                                                            "timeoutMs": {
                                                              "type": "integer",
                                                              "exclusiveMinimum": 0,
                                                              "maximum": 9007199254740991
                                                            }
                                                          },
                                                          "required": [
                                                            "enabled",
                                                            "minEligibleTools"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      },
                                                      "required": [
                                                        "destructiveCommands"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "automationTest": {
                                                      "type": "boolean"
                                                    },
                                                    "automationRun": {
                                                      "type": "boolean"
                                                    },
                                                    "automationBrainAccess": {
                                                      "type": "string",
                                                      "enum": [
                                                        "read_only",
                                                        "read_write"
                                                      ]
                                                    },
                                                    "automationKnowledgeGraphId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    }
                                                  },
                                                  "required": [
                                                    "sandboxLifecycle",
                                                    "executionRuntime",
                                                    "workspaceMode"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "budgetPolicy": {
                                                  "type": "object",
                                                  "properties": {
                                                    "maxTokensPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerRun": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxTokensPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "maxCostCentsPerTurn": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "tokensUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "costCentsUsed": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "behaviorSnapshot": {
                                                  "type": "object",
                                                  "properties": {
                                                    "agentPromptVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "pinnedSkills": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "skillVersionId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "executionMode": {
                                                            "type": "string",
                                                            "enum": [
                                                              "prompt",
                                                              "code"
                                                            ]
                                                          },
                                                          "allowedTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "body": {
                                                            "type": "string"
                                                          },
                                                          "bundleRef": {
                                                            "type": "string"
                                                          },
                                                          "bundleHash": {
                                                            "type": "string"
                                                          },
                                                          "metadata": {}
                                                        },
                                                        "required": [
                                                          "skillVersionId",
                                                          "executionMode",
                                                          "metadata"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "skillPolicies": {},
                                                    "model": {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "provider": {
                                                          "type": "string"
                                                        },
                                                        "params": {},
                                                        "temperature": {
                                                          "type": "number",
                                                          "minimum": 0,
                                                          "maximum": 2
                                                        },
                                                        "reasoning": {
                                                          "type": "string",
                                                          "enum": [
                                                            "off",
                                                            "low",
                                                            "medium",
                                                            "high",
                                                            "xhigh",
                                                            "max"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "params"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "modelRoutingPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptTemplate": {
                                                      "type": "string"
                                                    },
                                                    "systemPromptTemplateHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "toolCatalogHash": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "harness": {
                                                      "type": "object",
                                                      "properties": {
                                                        "version": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        },
                                                        "scoringVersion": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "version",
                                                        "scoringVersion"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "closePolicy": {
                                                      "type": "string",
                                                      "enum": [
                                                        "explicit",
                                                        "auto_on_idle",
                                                        "auto_on_parent_delivery"
                                                      ]
                                                    },
                                                    "wakePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "manual": {
                                                          "type": "boolean"
                                                        },
                                                        "schedules": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "id": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "cron": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "deliveryPolicy": {
                                                                "type": "string",
                                                                "enum": [
                                                                  "latest",
                                                                  "all",
                                                                  "count_only"
                                                                ]
                                                              }
                                                            },
                                                            "required": [
                                                              "id",
                                                              "cron",
                                                              "deliveryPolicy"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        },
                                                        "events": {
                                                          "type": "array",
                                                          "items": {
                                                            "type": "object",
                                                            "properties": {
                                                              "eventName": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "matchKey": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "eventName"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        }
                                                      },
                                                      "required": [
                                                        "manual",
                                                        "schedules",
                                                        "events"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "resourcePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "behavioral": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        },
                                                        "reference": {
                                                          "type": "string",
                                                          "enum": [
                                                            "pin_on_run_start",
                                                            "follow_latest_on_turn_start"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "behavioral",
                                                        "reference"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "runtimePolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "budgetPolicy": {
                                                      "type": "object",
                                                      "properties": {
                                                        "maxTokensPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerRun": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxTokensPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "maxCostCentsPerTurn": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "goalVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "corpusVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "outputSchema": {},
                                                    "packId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packVersionId": {
                                                      "type": "string",
                                                      "minLength": 1
                                                    },
                                                    "packBindings": {
                                                      "default": [],
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "requirementKey": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "packBindingId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "targetKind": {
                                                            "type": "string",
                                                            "enum": [
                                                              "connector",
                                                              "corpus"
                                                            ]
                                                          },
                                                          "targetId": {
                                                            "type": "string",
                                                            "minLength": 1
                                                          },
                                                          "enabledTools": {
                                                            "type": "array",
                                                            "items": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "policyOverrides": {}
                                                        },
                                                        "required": [
                                                          "requirementKey",
                                                          "packBindingId",
                                                          "targetKind",
                                                          "targetId"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    }
                                                  },
                                                  "required": [
                                                    "pinnedSkills",
                                                    "skillPolicies",
                                                    "model",
                                                    "systemPromptTemplate",
                                                    "systemPromptTemplateHash",
                                                    "toolCatalogHash",
                                                    "harness",
                                                    "closePolicy",
                                                    "wakePolicy",
                                                    "resourcePolicy",
                                                    "runtimePolicy",
                                                    "budgetPolicy",
                                                    "packBindings"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "shareToken": {
                                                  "type": "string"
                                                },
                                                "shareExpiresAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "artifactInputs": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "artifactId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "artifactVersionId": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "required": [
                                                      "artifactId",
                                                      "artifactVersionId"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "pinnedVersions": {
                                                  "type": "object",
                                                  "propertyNames": {
                                                    "type": "string"
                                                  },
                                                  "additionalProperties": {
                                                    "type": "string"
                                                  }
                                                },
                                                "waitingOnUserId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceBranchId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "workspaceOwnershipKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto_created",
                                                    "user_specified",
                                                    "inherited_from_parent"
                                                  ]
                                                },
                                                "executionRuntimeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "fast_virtual",
                                                    "dynamic_worker",
                                                    "required_full_os"
                                                  ]
                                                },
                                                "workspaceModeDerived": {
                                                  "type": "string",
                                                  "enum": [
                                                    "none",
                                                    "persistent"
                                                  ]
                                                },
                                                "archivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "deletedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "createdAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "updatedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "state": {
                                                  "type": "string",
                                                  "const": "abandoned"
                                                },
                                                "abandonReason": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "tenantId",
                                                "title",
                                                "actorKind",
                                                "actorId",
                                                "messageCount",
                                                "tokensUsed",
                                                "costCentsUsed",
                                                "executionRuntimeDerived",
                                                "workspaceModeDerived",
                                                "createdAt",
                                                "updatedAt",
                                                "state",
                                                "abandonReason"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        },
                                        "resolvedByDelivery": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "initial_start"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "userMessage": {
                                                      "type": "string"
                                                    },
                                                    "forkedFromRunId": {
                                                      "type": "string"
                                                    },
                                                    "forkedFromTurnId": {
                                                      "type": "string"
                                                    },
                                                    "idempotencyDomain": {
                                                      "type": "string"
                                                    },
                                                    "modelId": {
                                                      "type": "string"
                                                    },
                                                    "modelRoutingPolicyOverride": {
                                                      "type": "object",
                                                      "properties": {
                                                        "preferredProviderId": {
                                                          "type": "string"
                                                        },
                                                        "credentialId": {
                                                          "type": "string"
                                                        },
                                                        "allowPlatformCredentials": {
                                                          "type": "boolean"
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "systemPromptOverride": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "userMessage"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "user_message"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "messageId": {
                                                      "type": "string"
                                                    },
                                                    "content": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "messageId",
                                                    "content"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "human_response"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "runWaitId": {
                                                      "type": "string"
                                                    },
                                                    "response": {
                                                      "anyOf": [
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "decision": {
                                                              "type": "string",
                                                              "enum": [
                                                                "approved",
                                                                "rejected"
                                                              ]
                                                            },
                                                            "note": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "decision"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "optionIds": {
                                                              "minItems": 1,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "note": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "optionIds"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "text": {
                                                              "type": "string"
                                                            }
                                                          },
                                                          "required": [
                                                            "text"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "properties": {
                                                            "value": {}
                                                          },
                                                          "required": [
                                                            "value"
                                                          ],
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "runWaitId",
                                                    "response"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "child_run_result"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "childRunId": {
                                                      "type": "string"
                                                    },
                                                    "childTaskId": {
                                                      "type": "string"
                                                    },
                                                    "finalState": {
                                                      "type": "string",
                                                      "enum": [
                                                        "closed",
                                                        "failed",
                                                        "abandoned"
                                                      ]
                                                    },
                                                    "manifestArtifactId": {
                                                      "type": "string"
                                                    },
                                                    "visibleOutputArtifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "visibleOutputArtifacts": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "artifactId": {
                                                            "type": "string"
                                                          },
                                                          "name": {
                                                            "type": "string"
                                                          },
                                                          "type": {
                                                            "type": "string"
                                                          },
                                                          "workspacePath": {
                                                            "type": "string"
                                                          },
                                                          "contentHash": {
                                                            "type": "string"
                                                          }
                                                        },
                                                        "required": [
                                                          "artifactId",
                                                          "name",
                                                          "type",
                                                          "contentHash"
                                                        ],
                                                        "additionalProperties": false
                                                      }
                                                    },
                                                    "summary": {
                                                      "type": "string"
                                                    },
                                                    "tokensUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "costCentsUsed": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "runtimePolicyUsed": {
                                                      "type": "object",
                                                      "properties": {
                                                        "sandboxLifecycle": {
                                                          "type": "string",
                                                          "enum": [
                                                            "ephemeral_per_turn",
                                                            "snapshot_to_r2",
                                                            "warm_per_run"
                                                          ]
                                                        },
                                                        "executionRuntime": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "fast_virtual",
                                                            "dynamic_worker",
                                                            "required_full_os"
                                                          ]
                                                        },
                                                        "workspaceMode": {
                                                          "default": "none",
                                                          "type": "string",
                                                          "enum": [
                                                            "none",
                                                            "persistent"
                                                          ]
                                                        },
                                                        "directToolPolicy": {
                                                          "type": "object",
                                                          "properties": {
                                                            "workspaceWritePrefixes": {
                                                              "maxItems": 100,
                                                              "type": "array",
                                                              "items": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              }
                                                            },
                                                            "destructiveCommands": {
                                                              "default": "allow",
                                                              "type": "string",
                                                              "enum": [
                                                                "allow",
                                                                "deny"
                                                              ]
                                                            },
                                                            "codemode": {
                                                              "type": "object",
                                                              "properties": {
                                                                "enabled": {
                                                                  "default": true,
                                                                  "type": "boolean"
                                                                },
                                                                "minEligibleTools": {
                                                                  "default": 5,
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 1000
                                                                },
                                                                "timeoutMs": {
                                                                  "type": "integer",
                                                                  "exclusiveMinimum": 0,
                                                                  "maximum": 9007199254740991
                                                                }
                                                              },
                                                              "required": [
                                                                "enabled",
                                                                "minEligibleTools"
                                                              ],
                                                              "additionalProperties": false
                                                            }
                                                          },
                                                          "required": [
                                                            "destructiveCommands"
                                                          ],
                                                          "additionalProperties": false
                                                        },
                                                        "automationTest": {
                                                          "type": "boolean"
                                                        },
                                                        "automationRun": {
                                                          "type": "boolean"
                                                        },
                                                        "automationBrainAccess": {
                                                          "type": "string",
                                                          "enum": [
                                                            "read_only",
                                                            "read_write"
                                                          ]
                                                        },
                                                        "automationKnowledgeGraphId": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      },
                                                      "required": [
                                                        "sandboxLifecycle",
                                                        "executionRuntime",
                                                        "workspaceMode"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    "keyTaskIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "output": {},
                                                    "outputSchema": {}
                                                  },
                                                  "required": [
                                                    "childRunId",
                                                    "childTaskId",
                                                    "finalState",
                                                    "manifestArtifactId",
                                                    "visibleOutputArtifactIds",
                                                    "visibleOutputArtifacts"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "schedule_fire"
                                                },
                                                "sourcePayload": {
                                                  "oneOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "scheduleId": {
                                                          "type": "string"
                                                        },
                                                        "deliveryPolicy": {
                                                          "type": "string",
                                                          "const": "latest"
                                                        },
                                                        "firedAt": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        },
                                                        "coalescedCount": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "required": [
                                                        "scheduleId",
                                                        "deliveryPolicy",
                                                        "firedAt",
                                                        "coalescedCount"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "scheduleId": {
                                                          "type": "string"
                                                        },
                                                        "deliveryPolicy": {
                                                          "type": "string",
                                                          "const": "all"
                                                        },
                                                        "firedAt": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        }
                                                      },
                                                      "required": [
                                                        "scheduleId",
                                                        "deliveryPolicy",
                                                        "firedAt"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "scheduleId": {
                                                          "type": "string"
                                                        },
                                                        "deliveryPolicy": {
                                                          "type": "string",
                                                          "const": "count_only"
                                                        },
                                                        "firstScheduledFor": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        },
                                                        "latestScheduledFor": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        },
                                                        "missedFireCount": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "required": [
                                                        "scheduleId",
                                                        "deliveryPolicy",
                                                        "firstScheduledFor",
                                                        "latestScheduledFor",
                                                        "missedFireCount"
                                                      ],
                                                      "additionalProperties": false
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "external_event"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "eventName": {
                                                      "type": "string"
                                                    },
                                                    "matchKey": {
                                                      "type": "string"
                                                    },
                                                    "producer": {
                                                      "type": "string"
                                                    },
                                                    "occurredAt": {
                                                      "type": "string"
                                                    },
                                                    "data": {}
                                                  },
                                                  "required": [
                                                    "eventName",
                                                    "producer",
                                                    "occurredAt",
                                                    "data"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "cancel_run"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "reason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "cancel_wait"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "runWaitId": {
                                                      "type": "string"
                                                    },
                                                    "reason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "runWaitId"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "manual_resume"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "reason": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "wait_timeout"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "runWaitId": {
                                                      "type": "string"
                                                    },
                                                    "deadlineAt": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "runWaitId",
                                                    "deadlineAt"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "recovery_resume"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {},
                                                  "additionalProperties": {}
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "runId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "tenantId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "projectId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "sourceRef": {
                                                  "type": "string"
                                                },
                                                "idempotencyKey": {
                                                  "type": "string"
                                                },
                                                "transportKind": {
                                                  "type": "string",
                                                  "enum": [
                                                    "route",
                                                    "queue",
                                                    "workflow",
                                                    "alarm",
                                                    "internal"
                                                  ]
                                                },
                                                "transportMessageId": {
                                                  "type": "string"
                                                },
                                                "transport": {},
                                                "status": {
                                                  "type": "string",
                                                  "enum": [
                                                    "pending",
                                                    "consumed",
                                                    "ignored"
                                                  ]
                                                },
                                                "attemptCount": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "lastError": {
                                                  "type": "string"
                                                },
                                                "deadLetteredAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ignoredReason": {
                                                  "type": "string"
                                                },
                                                "nextRetryAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "inputArtifactId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "consumedByRunTurnId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "receivedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "consumedAt": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "sourceKind": {
                                                  "type": "string",
                                                  "const": "knowledge_event"
                                                },
                                                "sourcePayload": {
                                                  "type": "object",
                                                  "properties": {
                                                    "triggerId": {
                                                      "type": "string"
                                                    },
                                                    "triggerName": {
                                                      "type": "string"
                                                    },
                                                    "eventId": {
                                                      "type": "string"
                                                    },
                                                    "knowledgeGraphId": {
                                                      "type": "string"
                                                    },
                                                    "entityKind": {
                                                      "type": "string"
                                                    },
                                                    "nodeId": {
                                                      "type": "string"
                                                    },
                                                    "artifactVersionId": {
                                                      "type": "string"
                                                    },
                                                    "slug": {
                                                      "type": "string"
                                                    },
                                                    "title": {
                                                      "type": "string"
                                                    },
                                                    "changeType": {
                                                      "type": "string",
                                                      "enum": [
                                                        "created",
                                                        "updated",
                                                        "deleted"
                                                      ]
                                                    },
                                                    "causationDepth": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "triggerId",
                                                    "eventId",
                                                    "knowledgeGraphId",
                                                    "slug",
                                                    "changeType",
                                                    "causationDepth"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "runId",
                                                "tenantId",
                                                "idempotencyKey",
                                                "status",
                                                "attemptCount",
                                                "receivedAt",
                                                "sourceKind"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        },
                                        "explanation": {
                                          "type": "string"
                                        },
                                        "resolutionExplanation": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "wait",
                                        "explanation"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "waitGroup",
                                  "waits"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "runState",
                            "groups"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "inspector"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/fork": {
      "post": {
        "operationId": "Run_fork",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "fromRunTurnId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "overrides": {
                    "type": "object",
                    "properties": {
                      "modelId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "systemPrompt": {
                        "type": "string"
                      },
                      "freshSideEffects": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "required": [
                  "fromRunTurnId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/archive": {
      "post": {
        "operationId": "Run_archive",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/unarchive": {
      "post": {
        "operationId": "Run_unarchive",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "allOf": [
                            {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "pending"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "active"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "closed"
                                    },
                                    "output": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "failed"
                                    },
                                    "failureReason": {
                                      "type": "string"
                                    },
                                    "failureCategory": {
                                      "type": "string",
                                      "enum": [
                                        "provider_error",
                                        "invariant_violation",
                                        "unhandled_exception",
                                        "dependency_unavailable"
                                      ]
                                    },
                                    "failureDetail": {}
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "failureReason",
                                    "failureCategory"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "tenantId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "projectId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "actorKind": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "agent"
                                      ]
                                    },
                                    "actorId": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      ]
                                    },
                                    "parentRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "parentTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTurnId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "spawnedByTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "conversationId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "triggerDeliveryId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "evalRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "replayOfRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "goalId": {
                                      "type": "string"
                                    },
                                    "input": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {}
                                    },
                                    "messageCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "behaviorSnapshot": {
                                      "type": "object",
                                      "properties": {
                                        "agentPromptVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "pinnedSkills": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "skillVersionId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "executionMode": {
                                                "type": "string",
                                                "enum": [
                                                  "prompt",
                                                  "code"
                                                ]
                                              },
                                              "allowedTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "body": {
                                                "type": "string"
                                              },
                                              "bundleRef": {
                                                "type": "string"
                                              },
                                              "bundleHash": {
                                                "type": "string"
                                              },
                                              "metadata": {}
                                            },
                                            "required": [
                                              "skillVersionId",
                                              "executionMode",
                                              "metadata"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "skillPolicies": {},
                                        "model": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "provider": {
                                              "type": "string"
                                            },
                                            "params": {},
                                            "temperature": {
                                              "type": "number",
                                              "minimum": 0,
                                              "maximum": 2
                                            },
                                            "reasoning": {
                                              "type": "string",
                                              "enum": [
                                                "off",
                                                "low",
                                                "medium",
                                                "high",
                                                "xhigh",
                                                "max"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "params"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "modelRoutingPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "preferredProviderId": {
                                              "type": "string"
                                            },
                                            "credentialId": {
                                              "type": "string"
                                            },
                                            "allowPlatformCredentials": {
                                              "type": "boolean"
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "systemPromptTemplate": {
                                          "type": "string"
                                        },
                                        "systemPromptTemplateHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "toolCatalogHash": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "harness": {
                                          "type": "object",
                                          "properties": {
                                            "version": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "scoringVersion": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "version",
                                            "scoringVersion"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "closePolicy": {
                                          "type": "string",
                                          "enum": [
                                            "explicit",
                                            "auto_on_idle",
                                            "auto_on_parent_delivery"
                                          ]
                                        },
                                        "wakePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "manual": {
                                              "type": "boolean"
                                            },
                                            "schedules": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "cron": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "deliveryPolicy": {
                                                    "type": "string",
                                                    "enum": [
                                                      "latest",
                                                      "all",
                                                      "count_only"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "cron",
                                                  "deliveryPolicy"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            "events": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "eventName": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  },
                                                  "matchKey": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "eventName"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "manual",
                                            "schedules",
                                            "events"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "resourcePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "behavioral": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            },
                                            "reference": {
                                              "type": "string",
                                              "enum": [
                                                "pin_on_run_start",
                                                "follow_latest_on_turn_start"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "behavioral",
                                            "reference"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "runtimePolicy": {
                                          "type": "object",
                                          "properties": {
                                            "sandboxLifecycle": {
                                              "type": "string",
                                              "enum": [
                                                "ephemeral_per_turn",
                                                "snapshot_to_r2",
                                                "warm_per_run"
                                              ]
                                            },
                                            "executionRuntime": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "fast_virtual",
                                                "dynamic_worker",
                                                "required_full_os"
                                              ]
                                            },
                                            "workspaceMode": {
                                              "default": "none",
                                              "type": "string",
                                              "enum": [
                                                "none",
                                                "persistent"
                                              ]
                                            },
                                            "directToolPolicy": {
                                              "type": "object",
                                              "properties": {
                                                "workspaceWritePrefixes": {
                                                  "maxItems": 100,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "minLength": 1
                                                  }
                                                },
                                                "destructiveCommands": {
                                                  "default": "allow",
                                                  "type": "string",
                                                  "enum": [
                                                    "allow",
                                                    "deny"
                                                  ]
                                                },
                                                "codemode": {
                                                  "type": "object",
                                                  "properties": {
                                                    "enabled": {
                                                      "default": true,
                                                      "type": "boolean"
                                                    },
                                                    "minEligibleTools": {
                                                      "default": 5,
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 1000
                                                    },
                                                    "timeoutMs": {
                                                      "type": "integer",
                                                      "exclusiveMinimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "required": [
                                                    "enabled",
                                                    "minEligibleTools"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "destructiveCommands"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "automationTest": {
                                              "type": "boolean"
                                            },
                                            "automationRun": {
                                              "type": "boolean"
                                            },
                                            "automationBrainAccess": {
                                              "type": "string",
                                              "enum": [
                                                "read_only",
                                                "read_write"
                                              ]
                                            },
                                            "automationKnowledgeGraphId": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "sandboxLifecycle",
                                            "executionRuntime",
                                            "workspaceMode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "budgetPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "maxTokensPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerRun": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxTokensPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            },
                                            "maxCostCentsPerTurn": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "goalVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "corpusVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "outputSchema": {},
                                        "packId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packVersionId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "packBindings": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "requirementKey": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "packBindingId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "targetKind": {
                                                "type": "string",
                                                "enum": [
                                                  "connector",
                                                  "corpus"
                                                ]
                                              },
                                              "targetId": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "enabledTools": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              "policyOverrides": {}
                                            },
                                            "required": [
                                              "requirementKey",
                                              "packBindingId",
                                              "targetKind",
                                              "targetId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "pinnedSkills",
                                        "skillPolicies",
                                        "model",
                                        "systemPromptTemplate",
                                        "systemPromptTemplateHash",
                                        "toolCatalogHash",
                                        "harness",
                                        "closePolicy",
                                        "wakePolicy",
                                        "resourcePolicy",
                                        "runtimePolicy",
                                        "budgetPolicy",
                                        "packBindings"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "shareToken": {
                                      "type": "string"
                                    },
                                    "shareExpiresAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "artifactVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "artifactVersionId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "pinnedVersions": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string"
                                      },
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    },
                                    "waitingOnUserId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceBranchId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "workspaceOwnershipKind": {
                                      "type": "string",
                                      "enum": [
                                        "auto_created",
                                        "user_specified",
                                        "inherited_from_parent"
                                      ]
                                    },
                                    "executionRuntimeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceModeDerived": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "archivedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "deletedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "createdAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "updatedAt": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "state": {
                                      "type": "string",
                                      "const": "abandoned"
                                    },
                                    "abandonReason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "tenantId",
                                    "title",
                                    "actorKind",
                                    "actorId",
                                    "messageCount",
                                    "tokensUsed",
                                    "costCentsUsed",
                                    "executionRuntimeDerived",
                                    "workspaceModeDerived",
                                    "createdAt",
                                    "updatedAt",
                                    "state",
                                    "abandonReason"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "queued",
                                    "running",
                                    "input_required",
                                    "succeeded",
                                    "failed",
                                    "canceled"
                                  ]
                                }
                              },
                              "required": [
                                "status"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "run"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/share": {
      "post": {
        "operationId": "Run_createShareLink",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "shareToken": {
                          "type": "string"
                        },
                        "shareExpiresAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        }
                      },
                      "required": [
                        "shareToken",
                        "shareExpiresAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Run_revokeShareLink",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "revoked": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "revoked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/cancel": {
      "post": {
        "operationId": "Run_cancel",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/manual-resume": {
      "post": {
        "operationId": "Run_manualResume",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/waits/{runWaitId}/cancel": {
      "post": {
        "operationId": "Run_cancelWait",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "runWaitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/deliveries/{deliveryId}/retry": {
      "post": {
        "operationId": "Run_retryDelivery",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "delivery": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "initial_start"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "userMessage": {
                                      "type": "string"
                                    },
                                    "forkedFromRunId": {
                                      "type": "string"
                                    },
                                    "forkedFromTurnId": {
                                      "type": "string"
                                    },
                                    "idempotencyDomain": {
                                      "type": "string"
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "modelRoutingPolicyOverride": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptOverride": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "userMessage"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "user_message"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "messageId": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "messageId",
                                    "content"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "human_response"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "response": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "decision": {
                                              "type": "string",
                                              "enum": [
                                                "approved",
                                                "rejected"
                                              ]
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "decision"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "optionIds": {
                                              "minItems": 1,
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "text": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "value": {}
                                          },
                                          "required": [
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "runWaitId",
                                    "response"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "child_run_result"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "childRunId": {
                                      "type": "string"
                                    },
                                    "childTaskId": {
                                      "type": "string"
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string"
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string"
                                          },
                                          "workspacePath": {
                                            "type": "string"
                                          },
                                          "contentHash": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "keyTaskIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "childRunId",
                                    "childTaskId",
                                    "finalState",
                                    "manifestArtifactId",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "schedule_fire"
                                },
                                "sourcePayload": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "latest"
                                        },
                                        "firedAt": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "coalescedCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firedAt",
                                        "coalescedCount"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "all"
                                        },
                                        "firedAt": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firedAt"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "count_only"
                                        },
                                        "firstScheduledFor": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "latestScheduledFor": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "missedFireCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firstScheduledFor",
                                        "latestScheduledFor",
                                        "missedFireCount"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "external_event"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "eventName": {
                                      "type": "string"
                                    },
                                    "matchKey": {
                                      "type": "string"
                                    },
                                    "producer": {
                                      "type": "string"
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    },
                                    "data": {}
                                  },
                                  "required": [
                                    "eventName",
                                    "producer",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "cancel_run"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "cancel_wait"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runWaitId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "manual_resume"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "wait_timeout"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "deadlineAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runWaitId",
                                    "deadlineAt"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "recovery_resume"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {},
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "knowledge_event"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "triggerId": {
                                      "type": "string"
                                    },
                                    "triggerName": {
                                      "type": "string"
                                    },
                                    "eventId": {
                                      "type": "string"
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string"
                                    },
                                    "entityKind": {
                                      "type": "string"
                                    },
                                    "nodeId": {
                                      "type": "string"
                                    },
                                    "artifactVersionId": {
                                      "type": "string"
                                    },
                                    "slug": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "changeType": {
                                      "type": "string",
                                      "enum": [
                                        "created",
                                        "updated",
                                        "deleted"
                                      ]
                                    },
                                    "causationDepth": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "triggerId",
                                    "eventId",
                                    "knowledgeGraphId",
                                    "slug",
                                    "changeType",
                                    "causationDepth"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "delivery"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/deliveries/{deliveryId}/ignore": {
      "post": {
        "operationId": "Run_ignoreDelivery",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "delivery": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "initial_start"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "userMessage": {
                                      "type": "string"
                                    },
                                    "forkedFromRunId": {
                                      "type": "string"
                                    },
                                    "forkedFromTurnId": {
                                      "type": "string"
                                    },
                                    "idempotencyDomain": {
                                      "type": "string"
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "modelRoutingPolicyOverride": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptOverride": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "userMessage"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "user_message"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "messageId": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "messageId",
                                    "content"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "human_response"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "response": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "decision": {
                                              "type": "string",
                                              "enum": [
                                                "approved",
                                                "rejected"
                                              ]
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "decision"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "optionIds": {
                                              "minItems": 1,
                                              "type": "array",
                                              "items": {
                                                "type": "string"
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "text": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "value": {}
                                          },
                                          "required": [
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "runWaitId",
                                    "response"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "child_run_result"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "childRunId": {
                                      "type": "string"
                                    },
                                    "childTaskId": {
                                      "type": "string"
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string"
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string"
                                          },
                                          "workspacePath": {
                                            "type": "string"
                                          },
                                          "contentHash": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "keyTaskIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "childRunId",
                                    "childTaskId",
                                    "finalState",
                                    "manifestArtifactId",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "schedule_fire"
                                },
                                "sourcePayload": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "latest"
                                        },
                                        "firedAt": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "coalescedCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firedAt",
                                        "coalescedCount"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "all"
                                        },
                                        "firedAt": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firedAt"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "scheduleId": {
                                          "type": "string"
                                        },
                                        "deliveryPolicy": {
                                          "type": "string",
                                          "const": "count_only"
                                        },
                                        "firstScheduledFor": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "latestScheduledFor": {
                                          "type": "string",
                                          "format": "date-time",
                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                        },
                                        "missedFireCount": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "scheduleId",
                                        "deliveryPolicy",
                                        "firstScheduledFor",
                                        "latestScheduledFor",
                                        "missedFireCount"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "external_event"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "eventName": {
                                      "type": "string"
                                    },
                                    "matchKey": {
                                      "type": "string"
                                    },
                                    "producer": {
                                      "type": "string"
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    },
                                    "data": {}
                                  },
                                  "required": [
                                    "eventName",
                                    "producer",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "cancel_run"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "cancel_wait"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runWaitId"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "manual_resume"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "wait_timeout"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "runWaitId": {
                                      "type": "string"
                                    },
                                    "deadlineAt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "runWaitId",
                                    "deadlineAt"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "recovery_resume"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {},
                                  "additionalProperties": {}
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "runId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "sourceRef": {
                                  "type": "string"
                                },
                                "idempotencyKey": {
                                  "type": "string"
                                },
                                "transportKind": {
                                  "type": "string",
                                  "enum": [
                                    "route",
                                    "queue",
                                    "workflow",
                                    "alarm",
                                    "internal"
                                  ]
                                },
                                "transportMessageId": {
                                  "type": "string"
                                },
                                "transport": {},
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "consumed",
                                    "ignored"
                                  ]
                                },
                                "attemptCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "lastError": {
                                  "type": "string"
                                },
                                "deadLetteredAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ignoredReason": {
                                  "type": "string"
                                },
                                "nextRetryAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "inputArtifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "consumedByRunTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "receivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "consumedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "sourceKind": {
                                  "type": "string",
                                  "const": "knowledge_event"
                                },
                                "sourcePayload": {
                                  "type": "object",
                                  "properties": {
                                    "triggerId": {
                                      "type": "string"
                                    },
                                    "triggerName": {
                                      "type": "string"
                                    },
                                    "eventId": {
                                      "type": "string"
                                    },
                                    "knowledgeGraphId": {
                                      "type": "string"
                                    },
                                    "entityKind": {
                                      "type": "string"
                                    },
                                    "nodeId": {
                                      "type": "string"
                                    },
                                    "artifactVersionId": {
                                      "type": "string"
                                    },
                                    "slug": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "changeType": {
                                      "type": "string",
                                      "enum": [
                                        "created",
                                        "updated",
                                        "deleted"
                                      ]
                                    },
                                    "causationDepth": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "triggerId",
                                    "eventId",
                                    "knowledgeGraphId",
                                    "slug",
                                    "changeType",
                                    "causationDepth"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "runId",
                                "tenantId",
                                "idempotencyKey",
                                "status",
                                "attemptCount",
                                "receivedAt",
                                "sourceKind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "delivery"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/children/{childRunId}/retry": {
      "post": {
        "operationId": "Run_retryChild",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "childRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "delegationReason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "runtimeHint": {
                    "type": "string",
                    "enum": [
                      "none",
                      "fast_virtual",
                      "dynamic_worker",
                      "required_full_os"
                    ]
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "budgetPolicy": {
                    "type": "object",
                    "properties": {
                      "maxTokensPerRun": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxCostCentsPerRun": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxTokensPerTurn": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "maxCostCentsPerTurn": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  },
                  "artifactInputs": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "expectedOutputSchema": {},
                  "input": {},
                  "resumePolicy": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "all"
                          }
                        },
                        "required": [
                          "mode"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "any"
                          }
                        },
                        "required": [
                          "mode"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "mode": {
                            "type": "string",
                            "const": "count"
                          },
                          "requiredCount": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "mode",
                          "requiredCount"
                        ]
                      }
                    ]
                  },
                  "deadlineAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "timeoutPolicy": {
                    "type": "string",
                    "enum": [
                      "fail_run",
                      "resume_with_timeout",
                      "cancel_run"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "childRun": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "pending"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "active"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "closed"
                                },
                                "output": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "failed"
                                },
                                "failureReason": {
                                  "type": "string"
                                },
                                "failureCategory": {
                                  "type": "string",
                                  "enum": [
                                    "provider_error",
                                    "invariant_violation",
                                    "unhandled_exception",
                                    "dependency_unavailable"
                                  ]
                                },
                                "failureDetail": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "failureReason",
                                "failureCategory"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "abandoned"
                                },
                                "abandonReason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "abandonReason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "task": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runTurnId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentTaskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "tool",
                                "skill",
                                "human_input",
                                "child_run",
                                "external_wait"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed",
                                "abandoned",
                                "skipped",
                                "cancelled"
                              ]
                            },
                            "sequenceNumber": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skillName": {
                              "type": "string"
                            },
                            "skillVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "request": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "tool"
                                    },
                                    "toolName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "args": {},
                                    "toolUseId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "toolName",
                                    "args"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "skillHandle": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "context": {}
                                  },
                                  "required": [
                                    "role",
                                    "skillHandle",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "approval"
                                        },
                                        "proposedActionSummary": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "approvalSubject": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "skill_activation"
                                                },
                                                "skillHandle": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "skillVersionId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "input": {},
                                                    "artifactIds": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      }
                                                    },
                                                    "context": {}
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "skillHandle",
                                                "skillId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "kind": {
                                                  "type": "string",
                                                  "const": "tool_activation"
                                                },
                                                "toolName": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "connectorId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "toolUseId": {
                                                  "type": "string",
                                                  "minLength": 1
                                                },
                                                "request": {
                                                  "type": "object",
                                                  "properties": {
                                                    "args": {}
                                                  },
                                                  "required": [
                                                    "args"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "kind",
                                                "toolName",
                                                "connectorId",
                                                "request"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "proposedActionSummary"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "selection"
                                        },
                                        "options": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "label": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "description": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "allowMultiple": {
                                          "type": "boolean"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "options"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "freeform"
                                        },
                                        "responseHint": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "human_input"
                                        },
                                        "title": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "prompt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "relatedArtifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "allowedResponders": {
                                          "type": "object",
                                          "properties": {
                                            "userIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "roleIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "deadlineAt": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "timeoutPolicy": {
                                          "type": "string",
                                          "enum": [
                                            "fail_run",
                                            "resume_with_timeout",
                                            "cancel_run"
                                          ]
                                        },
                                        "requestType": {
                                          "type": "string",
                                          "const": "structured"
                                        },
                                        "responseSchema": {}
                                      },
                                      "required": [
                                        "role",
                                        "title",
                                        "prompt",
                                        "relatedArtifactIds",
                                        "allowedResponders",
                                        "timeoutPolicy",
                                        "requestType",
                                        "responseSchema"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "agentId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "input": {},
                                    "title": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "modelId": {
                                      "type": "string"
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "artifactInputs": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "expectedOutputSchema": {},
                                    "delegationReason": {
                                      "type": "string"
                                    },
                                    "resumePolicy": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "all"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "any"
                                            }
                                          },
                                          "required": [
                                            "mode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "mode": {
                                              "type": "string",
                                              "const": "count"
                                            },
                                            "requiredCount": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "mode",
                                            "requiredCount"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "prompt",
                                    "agentId",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "prompt": {
                                      "type": "string"
                                    },
                                    "expectedPayloadSchema": {},
                                    "deadlineAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "timeoutPolicy": {
                                      "type": "string",
                                      "enum": [
                                        "fail_run",
                                        "resume_with_timeout",
                                        "cancel_run"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "timeoutPolicy"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "result": {
                              "oneOf": [
                                {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "completed"
                                        },
                                        "output": {},
                                        "artifactIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "const": "waiting"
                                        },
                                        "waitId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "waitGroupId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "waitId",
                                        "waitGroupId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "role": {
                                          "type": "string",
                                          "const": "tool"
                                        },
                                        "outcome": {
                                          "type": "string",
                                          "enum": [
                                            "failed",
                                            "skipped",
                                            "abandoned",
                                            "cancelled"
                                          ]
                                        },
                                        "reason": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "role",
                                        "outcome",
                                        "reason"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "skill"
                                    },
                                    "outcome": {
                                      "type": "string",
                                      "enum": [
                                        "completed",
                                        "failed",
                                        "abandoned",
                                        "cancelled"
                                      ]
                                    },
                                    "output": {},
                                    "artifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "reason": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "outcome"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "human_input"
                                    },
                                    "runWaitId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "requestTaskId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "responder": {
                                      "type": "object",
                                      "properties": {
                                        "userId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "tenantId": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "roleIds": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        }
                                      },
                                      "required": [
                                        "userId",
                                        "tenantId",
                                        "roleIds"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "respondedAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "decision": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "approved"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "rejected"
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "selected"
                                            },
                                            "optionIds": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "note": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "optionIds"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "freeform"
                                            },
                                            "text": {
                                              "type": "string",
                                              "minLength": 1
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "structured"
                                            },
                                            "value": {}
                                          },
                                          "required": [
                                            "type",
                                            "value"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "runWaitId",
                                    "requestTaskId",
                                    "responder",
                                    "respondedAt",
                                    "decision"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "child_run"
                                    },
                                    "childRunId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "finalState": {
                                      "type": "string",
                                      "enum": [
                                        "closed",
                                        "failed",
                                        "abandoned"
                                      ]
                                    },
                                    "manifestArtifactId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "visibleOutputArtifactIds": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "visibleOutputArtifacts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "artifactId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "name": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "type": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "workspacePath": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "contentHash": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "required": [
                                          "artifactId",
                                          "name",
                                          "type",
                                          "contentHash"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "summary": {
                                      "type": "string"
                                    },
                                    "costCentsUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "tokensUsed": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "runtimePolicyUsed": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "output": {},
                                    "outputSchema": {}
                                  },
                                  "required": [
                                    "role",
                                    "childRunId",
                                    "finalState",
                                    "visibleOutputArtifactIds",
                                    "visibleOutputArtifacts"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "role": {
                                      "type": "string",
                                      "const": "external_wait"
                                    },
                                    "eventName": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "matchKey": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "occurredAt": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "data": {},
                                    "producer": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "role",
                                    "eventName",
                                    "matchKey",
                                    "occurredAt",
                                    "data"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "responderId": {
                              "type": "string"
                            },
                            "claimedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "claimedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "childRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "groupId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "role",
                            "status",
                            "sequenceNumber",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "childRun",
                        "task"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/children/{childRunId}/cancel": {
      "post": {
        "operationId": "Run_cancelChild",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "childRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/comments/{commentId}/archive": {
      "post": {
        "operationId": "Run_archiveComment",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "commentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "comment": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "taskId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runArtifactId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "authorId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "body": {
                              "type": "string"
                            },
                            "archivedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "archivedByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "authorId",
                            "body",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "comment"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/participants/{userId}": {
      "patch": {
        "operationId": "Run_updateParticipant",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "driver",
                      "reviewer",
                      "approver",
                      "watcher",
                      "collaborator",
                      "observer"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "participant": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string"
                            },
                            "userEmail": {
                              "type": "string"
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "owner",
                                "driver",
                                "reviewer",
                                "approver",
                                "watcher",
                                "collaborator",
                                "observer"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "userId",
                            "role",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "participant"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Run_removeParticipant",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "removed": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "removed"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/handoff": {
      "post": {
        "operationId": "Run_handoff",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "toUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "toUserName": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "stayInvolved": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "toUserId",
                  "stayInvolved"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "transfer",
                            "delegate"
                          ]
                        }
                      },
                      "required": [
                        "mode"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/driver/transfer": {
      "post": {
        "operationId": "Run_transferDriver",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "toUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "toUserName": {
                    "type": "string"
                  },
                  "stayInvolved": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "toUserId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "driver": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "userName": {
                              "type": "string"
                            },
                            "userEmail": {
                              "type": "string"
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "owner",
                                "driver",
                                "reviewer",
                                "approver",
                                "watcher",
                                "collaborator",
                                "observer"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "runId",
                            "tenantId",
                            "userId",
                            "role",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "transfer",
                            "delegate"
                          ]
                        }
                      },
                      "required": [
                        "driver",
                        "mode"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/outcome": {
      "post": {
        "operationId": "Run_submitOutcome",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "success": {
                    "type": "boolean"
                  },
                  "metrics": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "number"
                    }
                  },
                  "source": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "success"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "outcome": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "outcome"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/transform": {
      "post": {
        "operationId": "Run_transformStream",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "executive_briefing",
                      "slide_summary",
                      "risk_report",
                      "custom"
                    ]
                  },
                  "customPrompt": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "format"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server-Sent Events stream of run frames.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/durable-stream": {
      "get": {
        "operationId": "Run_durableStream",
        "tags": [
          "Run"
        ],
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "live",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sse",
                "long-poll"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events stream of run frames.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/previews/{previewId}/revoke": {
      "post": {
        "operationId": "Preview_revoke",
        "tags": [
          "Preview"
        ],
        "parameters": [
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "revoked": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "revoked"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sandboxes": {
      "get": {
        "operationId": "Sandbox_list",
        "tags": [
          "Sandbox"
        ],
        "parameters": [
          {
            "name": "workspaceBranchId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "sandboxes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "workspaceBranchId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "required_full_os"
                                ]
                              },
                              "providerId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "provisioning",
                                  "attached",
                                  "released",
                                  "destroyed",
                                  "errored",
                                  "lost"
                                ]
                              },
                              "lastActivityAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "lastHealthyAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "workspaceBranchId",
                              "kind",
                              "providerId",
                              "status",
                              "lastActivityAt",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "sandboxes"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sandboxes/{sandboxId}": {
      "get": {
        "operationId": "Sandbox_get",
        "tags": [
          "Sandbox"
        ],
        "parameters": [
          {
            "name": "sandboxId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "sandbox": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceBranchId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "required_full_os"
                              ]
                            },
                            "providerId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "provisioning",
                                "attached",
                                "released",
                                "destroyed",
                                "errored",
                                "lost"
                              ]
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastHealthyAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceBranchId",
                            "kind",
                            "providerId",
                            "status",
                            "lastActivityAt",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "sandbox"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schedules": {
      "get": {
        "operationId": "Schedule_list",
        "tags": [
          "Schedule"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "knowledgeGraphId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schedules": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "knowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdByUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "expectedOutcome": {
                                "type": "string"
                              },
                              "requiredAccess": {
                                "type": "string",
                                "enum": [
                                  "read_only",
                                  "read_write"
                                ]
                              },
                              "input": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "cronExpression": {
                                "type": "string"
                              },
                              "timeZone": {
                                "type": "string"
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "pausedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "pausedReason": {
                                "type": "string"
                              },
                              "lastTestedFingerprint": {
                                "type": "string"
                              },
                              "lastTestRunId": {
                                "type": "string"
                              },
                              "lastTestOutcome": {
                                "type": "string",
                                "enum": [
                                  "passed",
                                  "failed"
                                ]
                              },
                              "lastTestSettledAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "lastTestPassedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "lastRunAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "agentId",
                              "createdByUserId",
                              "name",
                              "input",
                              "cronExpression",
                              "timeZone",
                              "enabled",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "schedules"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Schedule_create",
        "tags": [
          "Schedule"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expectedOutcome": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "requiredAccess": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  },
                  "input": {},
                  "cronExpression": {
                    "type": "string"
                  },
                  "timeZone": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "agentId",
                  "input",
                  "cronExpression"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schedule": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "cronExpression": {
                              "type": "string"
                            },
                            "timeZone": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestedFingerprint": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestOutcome": {
                              "type": "string",
                              "enum": [
                                "passed",
                                "failed"
                              ]
                            },
                            "lastTestSettledAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastTestPassedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastRunAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "agentId",
                            "createdByUserId",
                            "name",
                            "input",
                            "cronExpression",
                            "timeZone",
                            "enabled",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "schedule"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schedules/{id}": {
      "patch": {
        "operationId": "Schedule_update",
        "tags": [
          "Schedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "input": {},
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expectedOutcome": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "requiredAccess": {
                    "type": "string",
                    "enum": [
                      "read_only",
                      "read_write"
                    ]
                  },
                  "cronExpression": {
                    "type": "string"
                  },
                  "timeZone": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schedule": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdByUserId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "expectedOutcome": {
                              "type": "string"
                            },
                            "requiredAccess": {
                              "type": "string",
                              "enum": [
                                "read_only",
                                "read_write"
                              ]
                            },
                            "input": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            "cronExpression": {
                              "type": "string"
                            },
                            "timeZone": {
                              "type": "string"
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "pausedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "pausedReason": {
                              "type": "string"
                            },
                            "lastTestedFingerprint": {
                              "type": "string"
                            },
                            "lastTestRunId": {
                              "type": "string"
                            },
                            "lastTestOutcome": {
                              "type": "string",
                              "enum": [
                                "passed",
                                "failed"
                              ]
                            },
                            "lastTestSettledAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastTestPassedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "lastRunAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "agentId",
                            "createdByUserId",
                            "name",
                            "input",
                            "cronExpression",
                            "timeZone",
                            "enabled",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "schedule"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Schedule_delete",
        "tags": [
          "Schedule"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas": {
      "get": {
        "operationId": "Schema_list",
        "tags": [
          "Schema"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schemas": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "nodeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "edgeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "slug",
                              "name",
                              "description",
                              "nodeCount",
                              "edgeCount"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "schemas"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Schema_commit",
        "tags": [
          "Schema"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "nodes": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "description": {
                          "type": "string"
                        },
                        "properties": {
                          "type": "object",
                          "properties": {},
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "type"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "display": {
                          "type": "object",
                          "properties": {
                            "titleField": {
                              "type": "string",
                              "minLength": 1
                            },
                            "snippetField": {
                              "type": "string",
                              "minLength": 1
                            },
                            "urlField": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temporalField": {
                              "type": "string",
                              "minLength": 1
                            }
                          }
                        },
                        "identityField": {
                          "type": "string",
                          "minLength": 1
                        },
                        "representativeChunkIds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "samples": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "filename": {
                                "type": "string",
                                "minLength": 1
                              },
                              "extractedSnippet": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "filename",
                              "extractedSnippet"
                            ]
                          }
                        }
                      },
                      "required": [
                        "kind",
                        "description",
                        "properties",
                        "representativeChunkIds",
                        "samples"
                      ]
                    }
                  },
                  "edges": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "description": {
                          "type": "string"
                        },
                        "from": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "to": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "properties": {
                          "type": "object",
                          "properties": {},
                          "additionalProperties": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "type"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "signal": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "frontmatter-field"
                                },
                                "field": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "source",
                                "field"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "wikilink-mention"
                                }
                              },
                              "required": [
                                "source"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "regex"
                                },
                                "pattern": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "source",
                                "pattern"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "kind",
                        "description",
                        "from",
                        "to"
                      ]
                    }
                  },
                  "rationale": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "description",
                  "nodes",
                  "edges",
                  "rationale"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schema": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "origin": {
                                    "type": "string",
                                    "enum": [
                                      "compile-time",
                                      "runtime"
                                    ]
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "propsJsonSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  },
                                  "deprecated": {
                                    "type": "boolean"
                                  },
                                  "display": {
                                    "type": "object",
                                    "properties": {
                                      "titleField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "snippetField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "urlField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "temporalField": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "identityField": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "representativeChunkIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                },
                                "required": [
                                  "kind",
                                  "origin",
                                  "description",
                                  "propsJsonSchema",
                                  "deprecated"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "origin": {
                                    "type": "string",
                                    "enum": [
                                      "compile-time",
                                      "runtime"
                                    ]
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "fromKinds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "toKinds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "deprecated": {
                                    "type": "boolean"
                                  },
                                  "propsJsonSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  }
                                },
                                "required": [
                                  "name",
                                  "origin",
                                  "description",
                                  "fromKinds",
                                  "toKinds",
                                  "deprecated"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "capabilities": {
                              "type": "object",
                              "properties": {
                                "hasBuiltinIngest": {
                                  "type": "boolean"
                                },
                                "hasBuiltinAgent": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "slug",
                            "name",
                            "description",
                            "nodes",
                            "edges",
                            "capabilities"
                          ],
                          "additionalProperties": false
                        },
                        "schemaVersion": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fingerprint": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "serializedSchemaJson": {
                              "type": "string",
                              "minLength": 1
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdByRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "schemaSlug",
                            "fingerprint",
                            "name",
                            "description",
                            "serializedSchemaJson",
                            "nodeCount",
                            "edgeCount",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "schema",
                        "schemaVersion"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}": {
      "get": {
        "operationId": "Schema_get",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "schema": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "origin": {
                                    "type": "string",
                                    "enum": [
                                      "compile-time",
                                      "runtime"
                                    ]
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "propsJsonSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  },
                                  "deprecated": {
                                    "type": "boolean"
                                  },
                                  "display": {
                                    "type": "object",
                                    "properties": {
                                      "titleField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "snippetField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "urlField": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "temporalField": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "identityField": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "representativeChunkIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  }
                                },
                                "required": [
                                  "kind",
                                  "origin",
                                  "description",
                                  "propsJsonSchema",
                                  "deprecated"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "origin": {
                                    "type": "string",
                                    "enum": [
                                      "compile-time",
                                      "runtime"
                                    ]
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "fromKinds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "toKinds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "deprecated": {
                                    "type": "boolean"
                                  },
                                  "propsJsonSchema": {
                                    "$ref": "#/$defs/__schema0"
                                  }
                                },
                                "required": [
                                  "name",
                                  "origin",
                                  "description",
                                  "fromKinds",
                                  "toKinds",
                                  "deprecated"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "capabilities": {
                              "type": "object",
                              "properties": {
                                "hasBuiltinIngest": {
                                  "type": "boolean"
                                },
                                "hasBuiltinAgent": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "slug",
                            "name",
                            "description",
                            "nodes",
                            "edges",
                            "capabilities"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "schema"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/versions": {
      "get": {
        "operationId": "Schema_listVersions",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "schemaSlug": {
                                "type": "string",
                                "minLength": 1
                              },
                              "fingerprint": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "type": "string"
                              },
                              "serializedSchemaJson": {
                                "type": "string",
                                "minLength": 1
                              },
                              "nodeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "edgeCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdByRunId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "tenantId",
                              "schemaSlug",
                              "fingerprint",
                              "name",
                              "description",
                              "serializedSchemaJson",
                              "nodeCount",
                              "edgeCount",
                              "id",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "versions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/versions/{versionId}": {
      "get": {
        "operationId": "Schema_getVersion",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "version": {
                          "type": "object",
                          "properties": {
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fingerprint": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "type": "string"
                            },
                            "serializedSchemaJson": {
                              "type": "string",
                              "minLength": 1
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdByRunId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "tenantId",
                            "schemaSlug",
                            "fingerprint",
                            "name",
                            "description",
                            "serializedSchemaJson",
                            "nodeCount",
                            "edgeCount",
                            "id",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/knowledge-graph": {
      "get": {
        "operationId": "Schema_graph",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "knowledgeGraphId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "nodes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "minLength": 1
                              },
                              "title": {
                                "type": "string"
                              },
                              "occurredAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "edges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "fromKind": {
                                "type": "string",
                                "minLength": 1
                              },
                              "fromId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "toKind": {
                                "type": "string",
                                "minLength": 1
                              },
                              "toId": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "name",
                              "fromKind",
                              "fromId",
                              "toKind",
                              "toId"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "slug",
                        "name",
                        "nodes",
                        "edges"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/agents": {
      "get": {
        "operationId": "Schema_agents",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "skillNames": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "skillNames"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "agents"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/materialize": {
      "post": {
        "operationId": "Schema_materialize",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "corpusSlug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "artifactVersionIds": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "pending"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "active"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "closed"
                                },
                                "output": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "failed"
                                },
                                "failureReason": {
                                  "type": "string"
                                },
                                "failureCategory": {
                                  "type": "string",
                                  "enum": [
                                    "provider_error",
                                    "invariant_violation",
                                    "unhandled_exception",
                                    "dependency_unavailable"
                                  ]
                                },
                                "failureDetail": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "failureReason",
                                "failureCategory"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "abandoned"
                                },
                                "abandonReason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "abandonReason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "artifactVersionCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "run",
                        "artifactVersionCount"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/schemas/{slug}/induce": {
      "post": {
        "operationId": "Schema_induce",
        "tags": [
          "Schema"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "corpusSlug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "hints": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "corpusSlug"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "pending"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "active"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "closed"
                                },
                                "output": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "failed"
                                },
                                "failureReason": {
                                  "type": "string"
                                },
                                "failureCategory": {
                                  "type": "string",
                                  "enum": [
                                    "provider_error",
                                    "invariant_violation",
                                    "unhandled_exception",
                                    "dependency_unavailable"
                                  ]
                                },
                                "failureDetail": {}
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "failureReason",
                                "failureCategory"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "tenantId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "projectId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "title": {
                                  "type": "string"
                                },
                                "summary": {
                                  "type": "string"
                                },
                                "actorKind": {
                                  "type": "string",
                                  "enum": [
                                    "human",
                                    "agent"
                                  ]
                                },
                                "actorId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "parentRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "parentTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTurnId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "spawnedByTaskId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "conversationId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "triggerDeliveryId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "evalRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "replayOfRunId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "goalId": {
                                  "type": "string"
                                },
                                "input": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {}
                                },
                                "messageCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "closePolicy": {
                                  "type": "string",
                                  "enum": [
                                    "explicit",
                                    "auto_on_idle",
                                    "auto_on_parent_delivery"
                                  ]
                                },
                                "wakePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "manual": {
                                      "type": "boolean"
                                    },
                                    "schedules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "cron": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "deliveryPolicy": {
                                            "type": "string",
                                            "enum": [
                                              "latest",
                                              "all",
                                              "count_only"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "cron",
                                          "deliveryPolicy"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "eventName": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "matchKey": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "eventName"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "manual",
                                    "schedules",
                                    "events"
                                  ],
                                  "additionalProperties": false
                                },
                                "resourcePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "behavioral": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    },
                                    "reference": {
                                      "type": "string",
                                      "enum": [
                                        "pin_on_run_start",
                                        "follow_latest_on_turn_start"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "behavioral",
                                    "reference"
                                  ],
                                  "additionalProperties": false
                                },
                                "runtimePolicy": {
                                  "type": "object",
                                  "properties": {
                                    "sandboxLifecycle": {
                                      "type": "string",
                                      "enum": [
                                        "ephemeral_per_turn",
                                        "snapshot_to_r2",
                                        "warm_per_run"
                                      ]
                                    },
                                    "executionRuntime": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "default": "none",
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "automationTest": {
                                      "type": "boolean"
                                    },
                                    "automationRun": {
                                      "type": "boolean"
                                    },
                                    "automationBrainAccess": {
                                      "type": "string",
                                      "enum": [
                                        "read_only",
                                        "read_write"
                                      ]
                                    },
                                    "automationKnowledgeGraphId": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "sandboxLifecycle",
                                    "executionRuntime",
                                    "workspaceMode"
                                  ],
                                  "additionalProperties": false
                                },
                                "budgetPolicy": {
                                  "type": "object",
                                  "properties": {
                                    "maxTokensPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerRun": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxTokensPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "maxCostCentsPerTurn": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "tokensUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "costCentsUsed": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "behaviorSnapshot": {
                                  "type": "object",
                                  "properties": {
                                    "agentPromptVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "pinnedSkills": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "skillVersionId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "executionMode": {
                                            "type": "string",
                                            "enum": [
                                              "prompt",
                                              "code"
                                            ]
                                          },
                                          "allowedTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "body": {
                                            "type": "string"
                                          },
                                          "bundleRef": {
                                            "type": "string"
                                          },
                                          "bundleHash": {
                                            "type": "string"
                                          },
                                          "metadata": {}
                                        },
                                        "required": [
                                          "skillVersionId",
                                          "executionMode",
                                          "metadata"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "skillPolicies": {},
                                    "model": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "provider": {
                                          "type": "string"
                                        },
                                        "params": {},
                                        "temperature": {
                                          "type": "number",
                                          "minimum": 0,
                                          "maximum": 2
                                        },
                                        "reasoning": {
                                          "type": "string",
                                          "enum": [
                                            "off",
                                            "low",
                                            "medium",
                                            "high",
                                            "xhigh",
                                            "max"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "params"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "modelRoutingPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "preferredProviderId": {
                                          "type": "string"
                                        },
                                        "credentialId": {
                                          "type": "string"
                                        },
                                        "allowPlatformCredentials": {
                                          "type": "boolean"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "systemPromptTemplate": {
                                      "type": "string"
                                    },
                                    "systemPromptTemplateHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "toolCatalogHash": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "harness": {
                                      "type": "object",
                                      "properties": {
                                        "version": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "scoringVersion": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "version",
                                        "scoringVersion"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "closePolicy": {
                                      "type": "string",
                                      "enum": [
                                        "explicit",
                                        "auto_on_idle",
                                        "auto_on_parent_delivery"
                                      ]
                                    },
                                    "wakePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "manual": {
                                          "type": "boolean"
                                        },
                                        "schedules": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "cron": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "deliveryPolicy": {
                                                "type": "string",
                                                "enum": [
                                                  "latest",
                                                  "all",
                                                  "count_only"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "cron",
                                              "deliveryPolicy"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "events": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "eventName": {
                                                "type": "string",
                                                "minLength": 1
                                              },
                                              "matchKey": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "eventName"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "manual",
                                        "schedules",
                                        "events"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "resourcePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "behavioral": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        },
                                        "reference": {
                                          "type": "string",
                                          "enum": [
                                            "pin_on_run_start",
                                            "follow_latest_on_turn_start"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "behavioral",
                                        "reference"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "runtimePolicy": {
                                      "type": "object",
                                      "properties": {
                                        "sandboxLifecycle": {
                                          "type": "string",
                                          "enum": [
                                            "ephemeral_per_turn",
                                            "snapshot_to_r2",
                                            "warm_per_run"
                                          ]
                                        },
                                        "executionRuntime": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "fast_virtual",
                                            "dynamic_worker",
                                            "required_full_os"
                                          ]
                                        },
                                        "workspaceMode": {
                                          "default": "none",
                                          "type": "string",
                                          "enum": [
                                            "none",
                                            "persistent"
                                          ]
                                        },
                                        "directToolPolicy": {
                                          "type": "object",
                                          "properties": {
                                            "workspaceWritePrefixes": {
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            },
                                            "destructiveCommands": {
                                              "default": "allow",
                                              "type": "string",
                                              "enum": [
                                                "allow",
                                                "deny"
                                              ]
                                            },
                                            "codemode": {
                                              "type": "object",
                                              "properties": {
                                                "enabled": {
                                                  "default": true,
                                                  "type": "boolean"
                                                },
                                                "minEligibleTools": {
                                                  "default": 5,
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 1000
                                                },
                                                "timeoutMs": {
                                                  "type": "integer",
                                                  "exclusiveMinimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "enabled",
                                                "minEligibleTools"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "destructiveCommands"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "automationTest": {
                                          "type": "boolean"
                                        },
                                        "automationRun": {
                                          "type": "boolean"
                                        },
                                        "automationBrainAccess": {
                                          "type": "string",
                                          "enum": [
                                            "read_only",
                                            "read_write"
                                          ]
                                        },
                                        "automationKnowledgeGraphId": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "required": [
                                        "sandboxLifecycle",
                                        "executionRuntime",
                                        "workspaceMode"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "budgetPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "maxTokensPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerRun": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxTokensPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "maxCostCentsPerTurn": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "goalVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "corpusVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "outputSchema": {},
                                    "packId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packVersionId": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "packBindings": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "requirementKey": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "packBindingId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "targetKind": {
                                            "type": "string",
                                            "enum": [
                                              "connector",
                                              "corpus"
                                            ]
                                          },
                                          "targetId": {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          "enabledTools": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "policyOverrides": {}
                                        },
                                        "required": [
                                          "requirementKey",
                                          "packBindingId",
                                          "targetKind",
                                          "targetId"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "pinnedSkills",
                                    "skillPolicies",
                                    "model",
                                    "systemPromptTemplate",
                                    "systemPromptTemplateHash",
                                    "toolCatalogHash",
                                    "harness",
                                    "closePolicy",
                                    "wakePolicy",
                                    "resourcePolicy",
                                    "runtimePolicy",
                                    "budgetPolicy",
                                    "packBindings"
                                  ],
                                  "additionalProperties": false
                                },
                                "shareToken": {
                                  "type": "string"
                                },
                                "shareExpiresAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "artifactInputs": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "artifactId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "artifactVersionId": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "required": [
                                      "artifactId",
                                      "artifactVersionId"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pinnedVersions": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "waitingOnUserId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceBranchId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "workspaceOwnershipKind": {
                                  "type": "string",
                                  "enum": [
                                    "auto_created",
                                    "user_specified",
                                    "inherited_from_parent"
                                  ]
                                },
                                "executionRuntimeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "fast_virtual",
                                    "dynamic_worker",
                                    "required_full_os"
                                  ]
                                },
                                "workspaceModeDerived": {
                                  "type": "string",
                                  "enum": [
                                    "none",
                                    "persistent"
                                  ]
                                },
                                "archivedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "deletedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "state": {
                                  "type": "string",
                                  "const": "abandoned"
                                },
                                "abandonReason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "tenantId",
                                "title",
                                "actorKind",
                                "actorId",
                                "messageCount",
                                "tokensUsed",
                                "costCentsUsed",
                                "executionRuntimeDerived",
                                "workspaceModeDerived",
                                "createdAt",
                                "updatedAt",
                                "state",
                                "abandonReason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "knowledgeGraph": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "schemaSlug": {
                              "type": "string"
                            },
                            "corpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "corpusSlug": {
                              "type": "string"
                            },
                            "origin": {
                              "default": "seeded",
                              "type": "string",
                              "enum": [
                                "seeded",
                                "empty",
                                "empty_with_schema"
                              ]
                            },
                            "sourceCorpusId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceCorpusSlug": {
                              "type": "string"
                            },
                            "parentKnowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "parentKnowledgeGraphName": {
                              "type": "string"
                            },
                            "directChildCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "name": {
                              "type": "string"
                            },
                            "identity": {
                              "type": "object",
                              "properties": {
                                "brainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "key": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "name": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "externalId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                },
                                "purpose": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "parentBrainId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "generation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 512
                                },
                                "lifecycle": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "held",
                                    "archived",
                                    "deleting",
                                    "deleted"
                                  ]
                                }
                              },
                              "required": [
                                "brainId",
                                "key",
                                "name",
                                "subject",
                                "purpose",
                                "generation",
                                "lifecycle"
                              ],
                              "additionalProperties": false
                            },
                            "description": {
                              "type": "string"
                            },
                            "lifecycleState": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "inducing",
                                "ready",
                                "stale",
                                "errored"
                              ]
                            },
                            "policy": {
                              "type": "object",
                              "properties": {
                                "refresh": {
                                  "default": "manual",
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_corpus_change",
                                    "scheduled"
                                  ]
                                },
                                "structuring": {
                                  "type": "string",
                                  "enum": [
                                    "manual",
                                    "on_source_change"
                                  ]
                                },
                                "refreshCron": {
                                  "type": "string"
                                },
                                "inductionBudgetCents": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "refresh"
                              ],
                              "additionalProperties": false
                            },
                            "writePolicy": {
                              "type": "string",
                              "enum": [
                                "direct",
                                "propose"
                              ]
                            },
                            "availabilityState": {
                              "type": "string",
                              "enum": [
                                "active",
                                "held",
                                "deleted"
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "latestVersionId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "nodeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "edgeCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingChangeSetCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "connectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "activeConnectionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectionHealth": {
                              "type": "string",
                              "enum": [
                                "never_connected",
                                "healthy",
                                "degraded"
                              ]
                            },
                            "lastConnectionActivityAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "schemaSlug",
                            "corpusId",
                            "origin",
                            "name",
                            "identity",
                            "lifecycleState",
                            "policy",
                            "writePolicy",
                            "availabilityState",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "sampleSize": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "totalChunks": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "run",
                        "knowledgeGraph",
                        "sampleSize",
                        "totalChunks"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/shared/runs/{shareToken}": {
      "get": {
        "operationId": "SharedRun_get",
        "tags": [
          "SharedRun"
        ],
        "parameters": [
          {
            "name": "shareToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "run": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "title": {
                              "type": "string"
                            },
                            "summary": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "active",
                                "closed",
                                "failed",
                                "abandoned"
                              ]
                            },
                            "actorKind": {
                              "type": "string",
                              "enum": [
                                "human",
                                "agent"
                              ]
                            },
                            "agentName": {
                              "type": "string"
                            },
                            "messageCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "state",
                            "actorKind",
                            "messageCount",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant",
                                  "system"
                                ]
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "tool_call",
                                  "tool_result",
                                  "task_result",
                                  "status",
                                  "error"
                                ]
                              },
                              "content": {
                                "type": "string"
                              },
                              "toolName": {
                                "type": "string"
                              },
                              "toolSummary": {
                                "type": "string"
                              },
                              "sequence": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "role",
                              "kind",
                              "sequence",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "run",
                        "messages"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/skills": {
      "get": {
        "operationId": "Skill_list",
        "tags": [
          "Skill"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "skills": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "skills"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Skill_create",
        "tags": [
          "Skill"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d]))*$"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1024
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "skill"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/skills/{skillId}": {
      "get": {
        "operationId": "Skill_get",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "skill"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Skill_delete",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/skills/{skillId}/usage": {
      "get": {
        "operationId": "Skill_usage",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "versionCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "skillId",
                        "name",
                        "versionCount"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/skills/{skillId}/versions": {
      "get": {
        "operationId": "Skill_listVersions",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "versions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "versionNumber": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "contentHash": {
                                "type": "string",
                                "minLength": 1
                              },
                              "filesUrl": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "active",
                                  "superseded"
                                ]
                              },
                              "createdBy": {
                                "type": "string",
                                "minLength": 1
                              },
                              "body": {
                                "type": "string"
                              },
                              "allowedTools": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "license": {
                                "type": "string"
                              },
                              "compatibility": {
                                "type": "string"
                              },
                              "skillMetadata": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "string"
                                }
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "versionNumber",
                              "contentHash",
                              "filesUrl",
                              "status",
                              "allowedTools",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "versions"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Skill_pushVersion",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "versionNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "contentHash": {
                    "type": "string",
                    "minLength": 1
                  },
                  "filesUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "skillMd": {
                    "type": "string"
                  },
                  "resourceFiles": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "relativePath": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sha256": {
                          "type": "string",
                          "minLength": 1
                        },
                        "executable": {
                          "type": "boolean"
                        },
                        "kind": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "contentBase64": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 3000000
                        }
                      },
                      "required": [
                        "relativePath"
                      ]
                    }
                  },
                  "archive": {
                    "type": "object",
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "tar",
                          "tar_gzip"
                        ]
                      },
                      "contentBase64": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 50000000
                      },
                      "archiveUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "skillRoot": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      }
                    }
                  }
                },
                "required": [
                  "versionNumber"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "version": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "versionNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "contentHash": {
                              "type": "string",
                              "minLength": 1
                            },
                            "filesUrl": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "active",
                                "superseded"
                              ]
                            },
                            "createdBy": {
                              "type": "string",
                              "minLength": 1
                            },
                            "body": {
                              "type": "string"
                            },
                            "allowedTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "license": {
                              "type": "string"
                            },
                            "compatibility": {
                              "type": "string"
                            },
                            "skillMetadata": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "versionNumber",
                            "contentHash",
                            "filesUrl",
                            "status",
                            "allowedTools",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/skills/{skillId}/versions/{versionId}/promote": {
      "post": {
        "operationId": "Skill_promoteVersion",
        "tags": [
          "Skill"
        ],
        "parameters": [
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "promoted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "promoted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates": {
      "get": {
        "operationId": "Template_list",
        "tags": [
          "Template"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "templates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "difficulty": {
                                "type": "string",
                                "enum": [
                                  "beginner",
                                  "intermediate",
                                  "advanced"
                                ]
                              },
                              "estimatedRunSeconds": {
                                "type": "number"
                              },
                              "runtimeHint": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "fast_virtual",
                                  "dynamic_worker",
                                  "required_full_os"
                                ]
                              },
                              "workspaceMode": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "persistent"
                                ]
                              },
                              "directToolPolicy": {
                                "type": "object",
                                "properties": {
                                  "workspaceWritePrefixes": {
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "destructiveCommands": {
                                    "default": "allow",
                                    "type": "string",
                                    "enum": [
                                      "allow",
                                      "deny"
                                    ]
                                  },
                                  "codemode": {
                                    "type": "object",
                                    "properties": {
                                      "enabled": {
                                        "default": true,
                                        "type": "boolean"
                                      },
                                      "minEligibleTools": {
                                        "default": 5,
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 1000
                                      },
                                      "timeoutMs": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "enabled",
                                      "minEligibleTools"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "destructiveCommands"
                                ],
                                "additionalProperties": false
                              },
                              "toolProfileId": {
                                "type": "string"
                              },
                              "skills": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "prompt": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "description",
                                    "prompt"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "companionAgents": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "inputSchema": {},
                                    "systemPrompt": {
                                      "type": "string"
                                    },
                                    "runtimeHint": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "fast_virtual",
                                        "dynamic_worker",
                                        "required_full_os"
                                      ]
                                    },
                                    "workspaceMode": {
                                      "type": "string",
                                      "enum": [
                                        "none",
                                        "persistent"
                                      ]
                                    },
                                    "directToolPolicy": {
                                      "type": "object",
                                      "properties": {
                                        "workspaceWritePrefixes": {
                                          "maxItems": 100,
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "minLength": 1
                                          }
                                        },
                                        "destructiveCommands": {
                                          "default": "allow",
                                          "type": "string",
                                          "enum": [
                                            "allow",
                                            "deny"
                                          ]
                                        },
                                        "codemode": {
                                          "type": "object",
                                          "properties": {
                                            "enabled": {
                                              "default": true,
                                              "type": "boolean"
                                            },
                                            "minEligibleTools": {
                                              "default": 5,
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 1000
                                            },
                                            "timeoutMs": {
                                              "type": "integer",
                                              "exclusiveMinimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "enabled",
                                            "minEligibleTools"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "destructiveCommands"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "toolProfileId": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "description"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "artifacts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "description",
                                    "content"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "inputSchema": {},
                              "inputExamples": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "input": {}
                                  },
                                  "required": [
                                    "name",
                                    "input"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "systemPrompt": {
                                "type": "string"
                              },
                              "goal": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "rubric": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "dimension": {
                                          "type": "string"
                                        },
                                        "criteria": {
                                          "type": "string"
                                        },
                                        "weight": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "dimension",
                                        "criteria",
                                        "weight"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "cases": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "input": {},
                                        "expectedOutput": {}
                                      },
                                      "required": [
                                        "name",
                                        "input"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "name",
                                  "description",
                                  "rubric",
                                  "cases"
                                ],
                                "additionalProperties": false
                              },
                              "importSource": {
                                "type": "object",
                                "properties": {
                                  "label": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "items": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "agent",
                                            "artifact",
                                            "schema",
                                            "handoff",
                                            "eval_case",
                                            "other"
                                          ]
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "path": {
                                          "type": "string"
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "label"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "mappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "from": {
                                          "type": "string"
                                        },
                                        "to": {
                                          "type": "string"
                                        },
                                        "primitive": {
                                          "type": "string",
                                          "enum": [
                                            "Agent",
                                            "Skill",
                                            "Artifact",
                                            "Corpus",
                                            "Goal",
                                            "GoalCase"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "from",
                                        "to",
                                        "primitive"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "highlights": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "label",
                                  "items"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "category",
                              "difficulty",
                              "estimatedRunSeconds",
                              "skills",
                              "inputSchema",
                              "systemPrompt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "templates"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/{templateId}/clone": {
      "post": {
        "operationId": "Template_clone",
        "tags": [
          "Template"
        ],
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "agent": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "systemPrompt": {
                              "type": "string"
                            },
                            "inputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "outputSchema": {
                              "$ref": "#/$defs/__schema0"
                            },
                            "modelId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "temperature": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2
                            },
                            "reasoning": {
                              "type": "string",
                              "enum": [
                                "off",
                                "low",
                                "medium",
                                "high",
                                "xhigh",
                                "max"
                              ]
                            },
                            "modelRoutingPolicy": {
                              "type": "object",
                              "properties": {
                                "preferredProviderId": {
                                  "type": "string"
                                },
                                "credentialId": {
                                  "type": "string"
                                },
                                "allowPlatformCredentials": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "paused",
                                "deleted"
                              ]
                            },
                            "humanStartAllowed": {
                              "type": "boolean"
                            },
                            "evalSamplingRate": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 100
                            },
                            "runtimeHint": {
                              "type": "string",
                              "enum": [
                                "none",
                                "fast_virtual",
                                "dynamic_worker",
                                "required_full_os"
                              ]
                            },
                            "workspaceMode": {
                              "type": "string",
                              "enum": [
                                "none",
                                "persistent"
                              ]
                            },
                            "directToolPolicy": {
                              "type": "object",
                              "properties": {
                                "workspaceWritePrefixes": {
                                  "maxItems": 100,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "destructiveCommands": {
                                  "default": "allow",
                                  "type": "string",
                                  "enum": [
                                    "allow",
                                    "deny"
                                  ]
                                },
                                "codemode": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "default": true,
                                      "type": "boolean"
                                    },
                                    "minEligibleTools": {
                                      "default": 5,
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 1000
                                    },
                                    "timeoutMs": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "minEligibleTools"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "destructiveCommands"
                              ],
                              "additionalProperties": false
                            },
                            "toolProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "name",
                            "status",
                            "humanStartAllowed",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "skills": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "name",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "artifactIds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "goalId": {
                          "type": "string"
                        },
                        "report": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "items": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "agent",
                                          "artifact",
                                          "schema",
                                          "handoff",
                                          "eval_case",
                                          "other"
                                        ]
                                      },
                                      "label": {
                                        "type": "string"
                                      },
                                      "path": {
                                        "type": "string"
                                      },
                                      "detail": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "label"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "mappings": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "from": {
                                        "type": "string"
                                      },
                                      "to": {
                                        "type": "string"
                                      },
                                      "primitive": {
                                        "type": "string",
                                        "enum": [
                                          "Agent",
                                          "Skill",
                                          "Artifact",
                                          "Corpus",
                                          "Goal",
                                          "GoalCase"
                                        ]
                                      },
                                      "detail": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "from",
                                      "to",
                                      "primitive"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "highlights": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "label",
                                "items"
                              ],
                              "additionalProperties": false
                            },
                            "createdPrimitives": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "primitive": {
                                    "type": "string",
                                    "enum": [
                                      "Agent",
                                      "Skill",
                                      "Artifact",
                                      "Corpus",
                                      "Goal",
                                      "GoalCase"
                                    ]
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "labels": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "primitive",
                                  "count",
                                  "labels"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "createdPrimitives"
                          ],
                          "additionalProperties": false
                        },
                        "template": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "agent",
                        "skills",
                        "artifactIds",
                        "report",
                        "template"
                      ],
                      "additionalProperties": false,
                      "$defs": {
                        "__schema0": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/__schema0"
                              }
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/$defs/__schema0"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/preview": {
      "post": {
        "operationId": "Template_gstackPreview",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skills": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1
                        },
                        "content": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000000
                        },
                        "files": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "relativePath": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "sha256": {
                                "type": "string",
                                "minLength": 1
                              },
                              "executable": {
                                "type": "boolean"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "script",
                                  "reference",
                                  "asset",
                                  "other"
                                ]
                              },
                              "contentBase64": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 3000000
                              }
                            },
                            "required": [
                              "relativePath"
                            ]
                          }
                        }
                      },
                      "required": [
                        "path",
                        "content"
                      ]
                    }
                  }
                },
                "required": [
                  "skills"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/bundle/preview": {
      "post": {
        "operationId": "Template_gstackBundlePreview",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skillRoot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "files": {
                    "minItems": 1,
                    "maxItems": 10000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 3000000
                        },
                        "contentBase64": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 3000000
                        },
                        "executable": {
                          "type": "boolean"
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sha256": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "path"
                      ]
                    }
                  }
                },
                "required": [
                  "files"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        },
                        "sourceResult": {
                          "type": "object",
                          "properties": {
                            "packName": {
                              "type": "string"
                            },
                            "skillRoot": {
                              "type": "string"
                            },
                            "sourceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "sourceCount",
                            "diagnostics"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities",
                        "sourceResult"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/archive/preview": {
      "post": {
        "operationId": "Template_gstackArchivePreview",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skillRoot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "tar",
                      "tar_gzip"
                    ]
                  },
                  "contentBase64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000000
                  },
                  "archiveUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "github": {
                    "type": "object",
                    "properties": {
                      "owner": {
                        "type": "string",
                        "pattern": "^[\\w.-]+$"
                      },
                      "repo": {
                        "type": "string",
                        "pattern": "^[\\w.-]+$"
                      },
                      "ref": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "owner",
                      "repo"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        },
                        "sourceResult": {
                          "type": "object",
                          "properties": {
                            "packName": {
                              "type": "string"
                            },
                            "skillRoot": {
                              "type": "string"
                            },
                            "sourceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "archiveFormat": {
                              "type": "string",
                              "enum": [
                                "tar",
                                "tar_gzip"
                              ]
                            },
                            "fileCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "sourceCount",
                            "diagnostics",
                            "archiveFormat",
                            "fileCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities",
                        "sourceResult"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/import": {
      "post": {
        "operationId": "Template_gstackImport",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skills": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1
                        },
                        "content": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000000
                        },
                        "files": {
                          "maxItems": 1000,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "relativePath": {
                                "type": "string",
                                "minLength": 1
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "sha256": {
                                "type": "string",
                                "minLength": 1
                              },
                              "executable": {
                                "type": "boolean"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "script",
                                  "reference",
                                  "asset",
                                  "other"
                                ]
                              },
                              "contentBase64": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 3000000
                              }
                            },
                            "required": [
                              "relativePath"
                            ]
                          }
                        }
                      },
                      "required": [
                        "path",
                        "content"
                      ]
                    }
                  },
                  "createAgents": {
                    "type": "boolean"
                  },
                  "autoBindAgentInvocations": {
                    "type": "boolean"
                  },
                  "connectorBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "connectorId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1
                        },
                        "enabledTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "skillName",
                        "connectorId"
                      ]
                    }
                  },
                  "corpusBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "corpusId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "skillName",
                        "corpusId"
                      ]
                    }
                  },
                  "agentInvocationBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "alias": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "defaultWaitPolicy": {
                          "default": "wait_for_result",
                          "type": "string",
                          "enum": [
                            "wait_for_result",
                            "fire_and_forget"
                          ]
                        },
                        "timeoutMs": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maxConcurrentRuns": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sourceSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetAgentId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "alias",
                        "sourceSkillName"
                      ]
                    }
                  }
                },
                "required": [
                  "skills"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        },
                        "report": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "pack": {
                              "type": "object",
                              "properties": {
                                "packId": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "lifecycleState": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "errored",
                                    "uninstalled"
                                  ]
                                },
                                "packVersionId": {
                                  "type": "string"
                                },
                                "packVersionDeduplicated": {
                                  "type": "boolean"
                                },
                                "materializationHash": {
                                  "type": "string"
                                },
                                "sourceContentHash": {
                                  "type": "string"
                                },
                                "compilerVersion": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "packId",
                                "slug",
                                "namespace",
                                "name",
                                "lifecycleState",
                                "packVersionId",
                                "packVersionDeduplicated",
                                "materializationHash",
                                "sourceContentHash",
                                "compilerVersion"
                              ],
                              "additionalProperties": false
                            },
                            "sourceArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "reportArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "changeSet": {
                              "type": "object",
                              "properties": {
                                "changeSetId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "agentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string"
                                },
                                "itemCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "changeSetId",
                                "agentId",
                                "status",
                                "itemCount"
                              ],
                              "additionalProperties": false
                            },
                            "imported": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "skillCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "previousActiveSkillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "previousActiveSkillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "agentName": {
                                    "type": "string"
                                  },
                                  "agentPromptMode": {
                                    "type": "string"
                                  },
                                  "agentSystemPromptSha256": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillId",
                                  "skillName",
                                  "skillCreated",
                                  "skillVersionId",
                                  "skillVersionCreated",
                                  "skillVersionContentHash",
                                  "runtimeHint",
                                  "workspaceMode"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "connectorBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "connectorId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "target": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "connectorId",
                                  "enabledTools"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "corpusBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "corpusId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "corpusId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "agentInvocationBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourceSkillName": {
                                    "type": "string"
                                  },
                                  "sourceAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "targetSkillName": {
                                    "type": "string"
                                  },
                                  "targetAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "alias": {
                                    "type": "string"
                                  },
                                  "defaultWaitPolicy": {
                                    "type": "string",
                                    "enum": [
                                      "wait_for_result",
                                      "fire_and_forget"
                                    ]
                                  },
                                  "timeoutMs": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "maxConcurrentRuns": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "sourceSkillName",
                                  "sourceAgentId",
                                  "targetAgentId",
                                  "alias",
                                  "defaultWaitPolicy"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundConnectorRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundCorpusRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "read_corpus"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundAgentInvocationRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "can_invoke_agent"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundScheduleRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "schedule"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packMembers": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packMemberId": {
                                    "type": "string"
                                  },
                                  "memberKind": {
                                    "type": "string",
                                    "enum": [
                                      "agent",
                                      "skill"
                                    ]
                                  },
                                  "upstreamKey": {
                                    "type": "string"
                                  },
                                  "resolvedHandleId": {
                                    "type": "string"
                                  },
                                  "resolvedVersionId": {
                                    "type": "string"
                                  },
                                  "addressName": {
                                    "type": "string"
                                  },
                                  "blockingRequirementKeys": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packMemberId",
                                  "memberKind",
                                  "upstreamKey",
                                  "resolvedHandleId",
                                  "resolvedVersionId",
                                  "addressName",
                                  "blockingRequirementKeys"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packBindingId": {
                                    "type": "string"
                                  },
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "targetKind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "targetId": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packBindingId",
                                  "requirementKey",
                                  "targetKind",
                                  "targetId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "memberScope": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "requirementKey",
                                  "kind",
                                  "memberScope"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "createdSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdSkillVersionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAgentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectorBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "corpusBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "agentInvocationBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "reusedSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "label",
                            "pack",
                            "sourceArtifact",
                            "reportArtifact",
                            "imported",
                            "connectorBindings",
                            "corpusBindings",
                            "agentInvocationBindings",
                            "unboundConnectorRequirements",
                            "unboundCorpusRequirements",
                            "unboundAgentInvocationRequirements",
                            "unboundScheduleRequirements",
                            "packMembers",
                            "packBindings",
                            "unboundRequirements",
                            "createdSkillCount",
                            "createdSkillVersionCount",
                            "createdAgentCount",
                            "connectorBindingCount",
                            "corpusBindingCount",
                            "agentInvocationBindingCount",
                            "reusedSkillCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities",
                        "report"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/archive/import": {
      "post": {
        "operationId": "Template_gstackArchiveImport",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skillRoot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "tar",
                      "tar_gzip"
                    ]
                  },
                  "contentBase64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000000
                  },
                  "archiveUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "github": {
                    "type": "object",
                    "properties": {
                      "owner": {
                        "type": "string",
                        "pattern": "^[\\w.-]+$"
                      },
                      "repo": {
                        "type": "string",
                        "pattern": "^[\\w.-]+$"
                      },
                      "ref": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "owner",
                      "repo"
                    ]
                  },
                  "createAgents": {
                    "type": "boolean"
                  },
                  "autoBindAgentInvocations": {
                    "type": "boolean"
                  },
                  "connectorBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "connectorId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1
                        },
                        "enabledTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "skillName",
                        "connectorId"
                      ]
                    }
                  },
                  "corpusBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "corpusId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "skillName",
                        "corpusId"
                      ]
                    }
                  },
                  "agentInvocationBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "alias": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "defaultWaitPolicy": {
                          "default": "wait_for_result",
                          "type": "string",
                          "enum": [
                            "wait_for_result",
                            "fire_and_forget"
                          ]
                        },
                        "timeoutMs": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maxConcurrentRuns": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sourceSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetAgentId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "alias",
                        "sourceSkillName"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        },
                        "sourceResult": {
                          "type": "object",
                          "properties": {
                            "packName": {
                              "type": "string"
                            },
                            "skillRoot": {
                              "type": "string"
                            },
                            "sourceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "archiveFormat": {
                              "type": "string",
                              "enum": [
                                "tar",
                                "tar_gzip"
                              ]
                            },
                            "fileCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "sourceCount",
                            "diagnostics",
                            "archiveFormat",
                            "fileCount"
                          ],
                          "additionalProperties": false
                        },
                        "report": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "pack": {
                              "type": "object",
                              "properties": {
                                "packId": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "lifecycleState": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "errored",
                                    "uninstalled"
                                  ]
                                },
                                "packVersionId": {
                                  "type": "string"
                                },
                                "packVersionDeduplicated": {
                                  "type": "boolean"
                                },
                                "materializationHash": {
                                  "type": "string"
                                },
                                "sourceContentHash": {
                                  "type": "string"
                                },
                                "compilerVersion": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "packId",
                                "slug",
                                "namespace",
                                "name",
                                "lifecycleState",
                                "packVersionId",
                                "packVersionDeduplicated",
                                "materializationHash",
                                "sourceContentHash",
                                "compilerVersion"
                              ],
                              "additionalProperties": false
                            },
                            "sourceArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "reportArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "changeSet": {
                              "type": "object",
                              "properties": {
                                "changeSetId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "agentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string"
                                },
                                "itemCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "changeSetId",
                                "agentId",
                                "status",
                                "itemCount"
                              ],
                              "additionalProperties": false
                            },
                            "imported": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "skillCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "previousActiveSkillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "previousActiveSkillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "agentName": {
                                    "type": "string"
                                  },
                                  "agentPromptMode": {
                                    "type": "string"
                                  },
                                  "agentSystemPromptSha256": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillId",
                                  "skillName",
                                  "skillCreated",
                                  "skillVersionId",
                                  "skillVersionCreated",
                                  "skillVersionContentHash",
                                  "runtimeHint",
                                  "workspaceMode"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "connectorBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "connectorId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "target": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "connectorId",
                                  "enabledTools"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "corpusBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "corpusId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "corpusId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "agentInvocationBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourceSkillName": {
                                    "type": "string"
                                  },
                                  "sourceAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "targetSkillName": {
                                    "type": "string"
                                  },
                                  "targetAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "alias": {
                                    "type": "string"
                                  },
                                  "defaultWaitPolicy": {
                                    "type": "string",
                                    "enum": [
                                      "wait_for_result",
                                      "fire_and_forget"
                                    ]
                                  },
                                  "timeoutMs": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "maxConcurrentRuns": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "sourceSkillName",
                                  "sourceAgentId",
                                  "targetAgentId",
                                  "alias",
                                  "defaultWaitPolicy"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundConnectorRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundCorpusRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "read_corpus"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundAgentInvocationRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "can_invoke_agent"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundScheduleRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "schedule"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packMembers": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packMemberId": {
                                    "type": "string"
                                  },
                                  "memberKind": {
                                    "type": "string",
                                    "enum": [
                                      "agent",
                                      "skill"
                                    ]
                                  },
                                  "upstreamKey": {
                                    "type": "string"
                                  },
                                  "resolvedHandleId": {
                                    "type": "string"
                                  },
                                  "resolvedVersionId": {
                                    "type": "string"
                                  },
                                  "addressName": {
                                    "type": "string"
                                  },
                                  "blockingRequirementKeys": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packMemberId",
                                  "memberKind",
                                  "upstreamKey",
                                  "resolvedHandleId",
                                  "resolvedVersionId",
                                  "addressName",
                                  "blockingRequirementKeys"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packBindingId": {
                                    "type": "string"
                                  },
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "targetKind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "targetId": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packBindingId",
                                  "requirementKey",
                                  "targetKind",
                                  "targetId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "memberScope": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "requirementKey",
                                  "kind",
                                  "memberScope"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "createdSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdSkillVersionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAgentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectorBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "corpusBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "agentInvocationBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "reusedSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "label",
                            "pack",
                            "sourceArtifact",
                            "reportArtifact",
                            "imported",
                            "connectorBindings",
                            "corpusBindings",
                            "agentInvocationBindings",
                            "unboundConnectorRequirements",
                            "unboundCorpusRequirements",
                            "unboundAgentInvocationRequirements",
                            "unboundScheduleRequirements",
                            "packMembers",
                            "packBindings",
                            "unboundRequirements",
                            "createdSkillCount",
                            "createdSkillVersionCount",
                            "createdAgentCount",
                            "connectorBindingCount",
                            "corpusBindingCount",
                            "agentInvocationBindingCount",
                            "reusedSkillCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities",
                        "sourceResult",
                        "report"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/gstack/bundle/import": {
      "post": {
        "operationId": "Template_gstackBundleImport",
        "tags": [
          "Template"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "packName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "skillRoot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "files": {
                    "minItems": 1,
                    "maxItems": 10000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 3000000
                        },
                        "contentBase64": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 3000000
                        },
                        "executable": {
                          "type": "boolean"
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sha256": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "path"
                      ]
                    }
                  },
                  "createAgents": {
                    "type": "boolean"
                  },
                  "autoBindAgentInvocations": {
                    "type": "boolean"
                  },
                  "connectorBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "connectorId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1
                        },
                        "enabledTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "skillName",
                        "connectorId"
                      ]
                    }
                  },
                  "corpusBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "corpusId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "skillName",
                        "corpusId"
                      ]
                    }
                  },
                  "agentInvocationBindings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "alias": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "defaultWaitPolicy": {
                          "default": "wait_for_result",
                          "type": "string",
                          "enum": [
                            "wait_for_result",
                            "fire_and_forget"
                          ]
                        },
                        "timeoutMs": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maxConcurrentRuns": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sourceSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetSkillName": {
                          "type": "string",
                          "minLength": 1
                        },
                        "targetAgentId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "alias",
                        "sourceSkillName"
                      ]
                    }
                  }
                },
                "required": [
                  "files"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "compileResult": {
                          "type": "object",
                          "properties": {
                            "skills": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourcePath": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "prompt": {
                                    "type": "string"
                                  },
                                  "normalizedPrompt": {
                                    "type": "string"
                                  },
                                  "allowedTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "importStatus": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detectedCapabilities": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "llm_prompt",
                                        "human_input",
                                        "project_context",
                                        "browser",
                                        "credentialed_browser",
                                        "local_chrome",
                                        "artifact",
                                        "workspace_files",
                                        "shell",
                                        "git",
                                        "github",
                                        "deploy",
                                        "agent_invocation",
                                        "mcp",
                                        "gbrain",
                                        "web_search",
                                        "schedule"
                                      ]
                                    }
                                  },
                                  "toolMappings": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "upstream": {
                                          "type": "string"
                                        },
                                        "capability": {
                                          "type": "string",
                                          "enum": [
                                            "llm_prompt",
                                            "human_input",
                                            "project_context",
                                            "browser",
                                            "credentialed_browser",
                                            "local_chrome",
                                            "artifact",
                                            "workspace_files",
                                            "shell",
                                            "git",
                                            "github",
                                            "deploy",
                                            "agent_invocation",
                                            "mcp",
                                            "gbrain",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "target": {
                                          "type": "string",
                                          "enum": [
                                            "llm_skill_body",
                                            "run_wait_human_input",
                                            "read_corpus",
                                            "browser_run",
                                            "local_browser_handoff",
                                            "run_artifact",
                                            "read_artifact",
                                            "workspace_file",
                                            "run_command",
                                            "github_connector",
                                            "deploy_connector",
                                            "can_invoke_agent",
                                            "mcp_connector",
                                            "web_search",
                                            "schedule"
                                          ]
                                        },
                                        "status": {
                                          "type": "string",
                                          "enum": [
                                            "ready",
                                            "degraded",
                                            "blocked"
                                          ]
                                        },
                                        "detail": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "upstream",
                                        "capability",
                                        "target",
                                        "status",
                                        "detail"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "resourceFiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "relativePath": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "sizeBytes": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        "sha256": {
                                          "type": "string",
                                          "minLength": 1
                                        },
                                        "executable": {
                                          "type": "boolean"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "script",
                                            "reference",
                                            "asset",
                                            "other"
                                          ]
                                        },
                                        "contentBase64": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 3000000
                                        }
                                      },
                                      "required": [
                                        "relativePath"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "diagnostics": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "severity": {
                                          "type": "string",
                                          "enum": [
                                            "info",
                                            "warning",
                                            "error"
                                          ]
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "message": {
                                          "type": "string"
                                        },
                                        "sourcePath": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "severity",
                                        "code",
                                        "message"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "templateSkill": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "prompt": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "description",
                                      "prompt"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "sourcePath",
                                  "name",
                                  "description",
                                  "prompt",
                                  "normalizedPrompt",
                                  "allowedTools",
                                  "metadata",
                                  "runtimeHint",
                                  "workspaceMode",
                                  "importStatus",
                                  "detectedCapabilities",
                                  "toolMappings",
                                  "resourceFiles",
                                  "diagnostics",
                                  "templateSkill"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "summary": {
                              "type": "object",
                              "properties": {
                                "packName": {
                                  "type": "string"
                                },
                                "skillCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "readyCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "degradedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "blockedCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "runtimeCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "workspaceCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                },
                                "capabilityCounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string"
                                  },
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "skillCount",
                                "readyCount",
                                "degradedCount",
                                "blockedCount",
                                "runtimeCounts",
                                "workspaceCounts",
                                "capabilityCounts"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "skills",
                            "diagnostics",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        "importPlan": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ready",
                                      "degraded",
                                      "blocked"
                                    ]
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "label",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "mappings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "from": {
                                    "type": "string"
                                  },
                                  "to": {
                                    "type": "string"
                                  },
                                  "primitive": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "from",
                                  "to",
                                  "primitive"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "label",
                            "items",
                            "mappings"
                          ],
                          "additionalProperties": false
                        },
                        "runtimeCapabilities": {
                          "type": "object",
                          "properties": {
                            "webSearchProviderConfigured": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "webSearchProviderConfigured"
                          ],
                          "additionalProperties": false
                        },
                        "sourceResult": {
                          "type": "object",
                          "properties": {
                            "packName": {
                              "type": "string"
                            },
                            "skillRoot": {
                              "type": "string"
                            },
                            "sourceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "diagnostics": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "severity": {
                                    "type": "string",
                                    "enum": [
                                      "info",
                                      "warning",
                                      "error"
                                    ]
                                  },
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "severity",
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "sourceCount",
                            "diagnostics"
                          ],
                          "additionalProperties": false
                        },
                        "report": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "pack": {
                              "type": "object",
                              "properties": {
                                "packId": {
                                  "type": "string"
                                },
                                "slug": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "lifecycleState": {
                                  "type": "string",
                                  "enum": [
                                    "active",
                                    "errored",
                                    "uninstalled"
                                  ]
                                },
                                "packVersionId": {
                                  "type": "string"
                                },
                                "packVersionDeduplicated": {
                                  "type": "boolean"
                                },
                                "materializationHash": {
                                  "type": "string"
                                },
                                "sourceContentHash": {
                                  "type": "string"
                                },
                                "compilerVersion": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "packId",
                                "slug",
                                "namespace",
                                "name",
                                "lifecycleState",
                                "packVersionId",
                                "packVersionDeduplicated",
                                "materializationHash",
                                "sourceContentHash",
                                "compilerVersion"
                              ],
                              "additionalProperties": false
                            },
                            "sourceArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "reportArtifact": {
                              "type": "object",
                              "properties": {
                                "artifactId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "artifactVersionId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "contentHash": {
                                  "type": "string"
                                },
                                "deduplicated": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "artifactId",
                                "artifactVersionId",
                                "contentHash",
                                "deduplicated"
                              ],
                              "additionalProperties": false
                            },
                            "changeSet": {
                              "type": "object",
                              "properties": {
                                "changeSetId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "agentId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "status": {
                                  "type": "string"
                                },
                                "itemCount": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "changeSetId",
                                "agentId",
                                "status",
                                "itemCount"
                              ],
                              "additionalProperties": false
                            },
                            "imported": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "skillCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "skillVersionCreated": {
                                    "type": "boolean"
                                  },
                                  "skillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "previousActiveSkillVersionId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "previousActiveSkillVersionContentHash": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "agentName": {
                                    "type": "string"
                                  },
                                  "agentPromptMode": {
                                    "type": "string"
                                  },
                                  "agentSystemPromptSha256": {
                                    "type": "string"
                                  },
                                  "runtimeHint": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourcePath": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillId",
                                  "skillName",
                                  "skillCreated",
                                  "skillVersionId",
                                  "skillVersionCreated",
                                  "skillVersionContentHash",
                                  "runtimeHint",
                                  "workspaceMode"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "connectorBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "connectorId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "target": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "connectorId",
                                  "enabledTools"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "corpusBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "agentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "corpusId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "agentId",
                                  "corpusId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "agentInvocationBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "sourceSkillName": {
                                    "type": "string"
                                  },
                                  "sourceAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "targetSkillName": {
                                    "type": "string"
                                  },
                                  "targetAgentId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "alias": {
                                    "type": "string"
                                  },
                                  "defaultWaitPolicy": {
                                    "type": "string",
                                    "enum": [
                                      "wait_for_result",
                                      "fire_and_forget"
                                    ]
                                  },
                                  "timeoutMs": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "maxConcurrentRuns": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "sourceSkillName",
                                  "sourceAgentId",
                                  "targetAgentId",
                                  "alias",
                                  "defaultWaitPolicy"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundConnectorRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundCorpusRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "read_corpus"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundAgentInvocationRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "can_invoke_agent"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundScheduleRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "skillName": {
                                    "type": "string"
                                  },
                                  "capability": {
                                    "type": "string"
                                  },
                                  "detail": {
                                    "type": "string"
                                  },
                                  "target": {
                                    "type": "string",
                                    "const": "schedule"
                                  }
                                },
                                "required": [
                                  "skillName",
                                  "capability",
                                  "target"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packMembers": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packMemberId": {
                                    "type": "string"
                                  },
                                  "memberKind": {
                                    "type": "string",
                                    "enum": [
                                      "agent",
                                      "skill"
                                    ]
                                  },
                                  "upstreamKey": {
                                    "type": "string"
                                  },
                                  "resolvedHandleId": {
                                    "type": "string"
                                  },
                                  "resolvedVersionId": {
                                    "type": "string"
                                  },
                                  "addressName": {
                                    "type": "string"
                                  },
                                  "blockingRequirementKeys": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packMemberId",
                                  "memberKind",
                                  "upstreamKey",
                                  "resolvedHandleId",
                                  "resolvedVersionId",
                                  "addressName",
                                  "blockingRequirementKeys"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "packBindings": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "packBindingId": {
                                    "type": "string"
                                  },
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "targetKind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "targetId": {
                                    "type": "string"
                                  },
                                  "enabledTools": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "packBindingId",
                                  "requirementKey",
                                  "targetKind",
                                  "targetId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unboundRequirements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "requirementKey": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "connector",
                                      "corpus"
                                    ]
                                  },
                                  "memberScope": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "requirementKey",
                                  "kind",
                                  "memberScope"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "createdSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdSkillVersionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "createdAgentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "connectorBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "corpusBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "agentInvocationBindingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "reusedSkillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "label",
                            "pack",
                            "sourceArtifact",
                            "reportArtifact",
                            "imported",
                            "connectorBindings",
                            "corpusBindings",
                            "agentInvocationBindings",
                            "unboundConnectorRequirements",
                            "unboundCorpusRequirements",
                            "unboundAgentInvocationRequirements",
                            "unboundScheduleRequirements",
                            "packMembers",
                            "packBindings",
                            "unboundRequirements",
                            "createdSkillCount",
                            "createdSkillVersionCount",
                            "createdAgentCount",
                            "connectorBindingCount",
                            "corpusBindingCount",
                            "agentInvocationBindingCount",
                            "reusedSkillCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "compileResult",
                        "importPlan",
                        "runtimeCapabilities",
                        "sourceResult",
                        "report"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/toolsets": {
      "get": {
        "operationId": "Toolset_list",
        "tags": [
          "Toolset"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "catalog": {
                          "type": "object",
                          "properties": {
                            "tools": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "label": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "description": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "enum": [
                                      "platform_builtin",
                                      "platform_blocker",
                                      "connector",
                                      "skill"
                                    ]
                                  },
                                  "access": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "read",
                                        "write",
                                        "external",
                                        "compute",
                                        "human"
                                      ]
                                    }
                                  },
                                  "minimumRuntime": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "requiredCapability": {
                                    "type": "string",
                                    "enum": [
                                      "browser_run",
                                      "web_search"
                                    ]
                                  }
                                },
                                "required": [
                                  "name",
                                  "label",
                                  "description",
                                  "sourceKind",
                                  "access",
                                  "minimumRuntime",
                                  "workspaceMode"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "toolsets": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "label": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "description": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "enum": [
                                      "platform",
                                      "custom"
                                    ]
                                  },
                                  "category": {
                                    "type": "string",
                                    "enum": [
                                      "core",
                                      "web",
                                      "knowledge",
                                      "browser",
                                      "workspace",
                                      "coordination",
                                      "connector"
                                    ]
                                  },
                                  "toolNames": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "minimumRuntime": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "fast_virtual",
                                      "dynamic_worker",
                                      "required_full_os"
                                    ]
                                  },
                                  "workspaceMode": {
                                    "type": "string",
                                    "enum": [
                                      "none",
                                      "persistent"
                                    ]
                                  },
                                  "sideEffectLabel": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "defaultEnabled": {
                                    "type": "boolean"
                                  },
                                  "directToolPolicy": {
                                    "type": "object",
                                    "properties": {
                                      "workspaceWritePrefixes": {
                                        "maxItems": 100,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1
                                        }
                                      },
                                      "destructiveCommands": {
                                        "default": "allow",
                                        "type": "string",
                                        "enum": [
                                          "allow",
                                          "deny"
                                        ]
                                      },
                                      "codemode": {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": true,
                                            "type": "boolean"
                                          },
                                          "minEligibleTools": {
                                            "default": 5,
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 1000
                                          },
                                          "timeoutMs": {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "minEligibleTools"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "destructiveCommands"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "id",
                                  "label",
                                  "description",
                                  "sourceKind",
                                  "category",
                                  "toolNames",
                                  "minimumRuntime",
                                  "workspaceMode",
                                  "sideEffectLabel",
                                  "defaultEnabled"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "profiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "label": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "description": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "sourceKind": {
                                    "type": "string",
                                    "enum": [
                                      "platform",
                                      "custom"
                                    ]
                                  },
                                  "toolsetIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "defaultForNewAgents": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "label",
                                  "description",
                                  "sourceKind",
                                  "toolsetIds",
                                  "defaultForNewAgents"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "defaultProfileId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "runtimeCapabilities": {
                              "type": "object",
                              "properties": {
                                "browserRunProviderConfigured": {
                                  "type": "boolean"
                                },
                                "webSearchProviderConfigured": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "browserRunProviderConfigured",
                                "webSearchProviderConfigured"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "tools",
                            "toolsets",
                            "profiles",
                            "defaultProfileId",
                            "runtimeCapabilities"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "catalog"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/distill": {
      "post": {
        "operationId": "TraceDistillation_kickoff",
        "tags": [
          "TraceDistillation"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "goalName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "goalDescription": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "goalId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "goalName"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "goalName": {
                              "type": "string"
                            },
                            "goalDescription": {
                              "type": "string"
                            },
                            "goalId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "processing",
                                "completed",
                                "partial",
                                "failed"
                              ]
                            },
                            "algorithm": {
                              "type": "string",
                              "enum": [
                                "kmeans",
                                "recursive_decomposition"
                              ]
                            },
                            "algorithmVersion": {
                              "type": "string"
                            },
                            "model": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "sampleWindow": {
                              "type": "object",
                              "properties": {
                                "sampleSize": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "earliestOccurredAt": {
                                  "type": "string"
                                },
                                "latestOccurredAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "sampleSize"
                              ],
                              "additionalProperties": false
                            },
                            "totalClusters": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "processedClusters": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skippedClusterIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "dimensions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "clusterId": {
                                    "type": "string"
                                  },
                                  "clusterLabel": {
                                    "type": "string"
                                  },
                                  "clusterSize": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "cases": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "description": {
                                          "type": "string"
                                        },
                                        "citations": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "runId": {
                                                "type": "string"
                                              },
                                              "turns": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "enum": [
                                                        "user",
                                                        "assistant"
                                                      ]
                                                    },
                                                    "runMessageId": {
                                                      "type": "string"
                                                    },
                                                    "text": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "runMessageId",
                                                    "text"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "occurredAt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "runId",
                                              "turns"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "description",
                                        "citations"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "clusterId",
                                  "clusterLabel",
                                  "clusterSize",
                                  "dimension",
                                  "criteria",
                                  "cases"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "agentId",
                            "goalName",
                            "status",
                            "algorithm",
                            "algorithmVersion",
                            "promptVersion",
                            "processedClusters",
                            "skippedClusterIds",
                            "dimensions",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "TraceDistillation_list",
        "tags": [
          "TraceDistillation"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "jobs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "goalName": {
                                "type": "string"
                              },
                              "goalDescription": {
                                "type": "string"
                              },
                              "goalId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "processing",
                                  "completed",
                                  "partial",
                                  "failed"
                                ]
                              },
                              "algorithm": {
                                "type": "string",
                                "enum": [
                                  "kmeans",
                                  "recursive_decomposition"
                                ]
                              },
                              "algorithmVersion": {
                                "type": "string"
                              },
                              "model": {
                                "type": "string"
                              },
                              "promptVersion": {
                                "type": "string"
                              },
                              "sampleWindow": {
                                "type": "object",
                                "properties": {
                                  "sampleSize": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "earliestOccurredAt": {
                                    "type": "string"
                                  },
                                  "latestOccurredAt": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "sampleSize"
                                ],
                                "additionalProperties": false
                              },
                              "totalClusters": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "processedClusters": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "skippedClusterIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "dimensions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "clusterId": {
                                      "type": "string"
                                    },
                                    "clusterLabel": {
                                      "type": "string"
                                    },
                                    "clusterSize": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "dimension": {
                                      "type": "string"
                                    },
                                    "criteria": {
                                      "type": "string"
                                    },
                                    "cases": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "description": {
                                            "type": "string"
                                          },
                                          "citations": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "runId": {
                                                  "type": "string"
                                                },
                                                "turns": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "role": {
                                                        "type": "string",
                                                        "enum": [
                                                          "user",
                                                          "assistant"
                                                        ]
                                                      },
                                                      "runMessageId": {
                                                        "type": "string"
                                                      },
                                                      "text": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": [
                                                      "role",
                                                      "runMessageId",
                                                      "text"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "occurredAt": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "runId",
                                                "turns"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "description",
                                          "citations"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "clusterId",
                                    "clusterLabel",
                                    "clusterSize",
                                    "dimension",
                                    "criteria",
                                    "cases"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "failureReason": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "agentId",
                              "goalName",
                              "status",
                              "algorithm",
                              "algorithmVersion",
                              "promptVersion",
                              "processedClusters",
                              "skippedClusterIds",
                              "dimensions",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "jobs"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/agents/{agentId}/distill/{jobId}": {
      "get": {
        "operationId": "TraceDistillation_get",
        "tags": [
          "TraceDistillation"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "job": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "goalName": {
                              "type": "string"
                            },
                            "goalDescription": {
                              "type": "string"
                            },
                            "goalId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "processing",
                                "completed",
                                "partial",
                                "failed"
                              ]
                            },
                            "algorithm": {
                              "type": "string",
                              "enum": [
                                "kmeans",
                                "recursive_decomposition"
                              ]
                            },
                            "algorithmVersion": {
                              "type": "string"
                            },
                            "model": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "sampleWindow": {
                              "type": "object",
                              "properties": {
                                "sampleSize": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "earliestOccurredAt": {
                                  "type": "string"
                                },
                                "latestOccurredAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "sampleSize"
                              ],
                              "additionalProperties": false
                            },
                            "totalClusters": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "processedClusters": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "skippedClusterIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "dimensions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "clusterId": {
                                    "type": "string"
                                  },
                                  "clusterLabel": {
                                    "type": "string"
                                  },
                                  "clusterSize": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "dimension": {
                                    "type": "string"
                                  },
                                  "criteria": {
                                    "type": "string"
                                  },
                                  "cases": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "description": {
                                          "type": "string"
                                        },
                                        "citations": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "runId": {
                                                "type": "string"
                                              },
                                              "turns": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "role": {
                                                      "type": "string",
                                                      "enum": [
                                                        "user",
                                                        "assistant"
                                                      ]
                                                    },
                                                    "runMessageId": {
                                                      "type": "string"
                                                    },
                                                    "text": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "role",
                                                    "runMessageId",
                                                    "text"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              },
                                              "occurredAt": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "runId",
                                              "turns"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "description",
                                        "citations"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "clusterId",
                                  "clusterLabel",
                                  "clusterSize",
                                  "dimension",
                                  "criteria",
                                  "cases"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "failureReason": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "agentId",
                            "goalName",
                            "status",
                            "algorithm",
                            "algorithmVersion",
                            "promptVersion",
                            "processedClusters",
                            "skippedClusterIds",
                            "dimensions",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "job"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "operationId": "Webhook_register",
        "tags": [
          "Webhook"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "run.created",
                        "run.completed",
                        "run.failed",
                        "run.abandoned",
                        "task.created",
                        "task.completed",
                        "task.expired",
                        "operation.succeeded",
                        "operation.failed",
                        "operation.abandoned",
                        "knowledge.corrected"
                      ]
                    }
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "knowledgeGraphId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "webhook": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "url": {
                              "type": "string"
                            },
                            "secret": {
                              "type": "string"
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "run.created",
                                  "run.completed",
                                  "run.failed",
                                  "run.abandoned",
                                  "task.created",
                                  "task.completed",
                                  "task.expired",
                                  "operation.succeeded",
                                  "operation.failed",
                                  "operation.abandoned",
                                  "knowledge.corrected",
                                  "extraction.completed",
                                  "review.settled",
                                  "batch.admitted"
                                ]
                              }
                            },
                            "active": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "url",
                            "events",
                            "active",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "webhook"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "Webhook_list",
        "tags": [
          "Webhook"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "webhooks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "agentId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "knowledgeGraphId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "url": {
                                "type": "string"
                              },
                              "secret": {
                                "type": "string"
                              },
                              "events": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "run.created",
                                    "run.completed",
                                    "run.failed",
                                    "run.abandoned",
                                    "task.created",
                                    "task.completed",
                                    "task.expired",
                                    "operation.succeeded",
                                    "operation.failed",
                                    "operation.abandoned",
                                    "knowledge.corrected",
                                    "extraction.completed",
                                    "review.settled",
                                    "batch.admitted"
                                  ]
                                }
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "tenantId",
                              "url",
                              "events",
                              "active",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "webhooks"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "operationId": "Webhook_get",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "webhook": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "tenantId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "projectId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "agentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "knowledgeGraphId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "url": {
                              "type": "string"
                            },
                            "secret": {
                              "type": "string"
                            },
                            "events": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "run.created",
                                  "run.completed",
                                  "run.failed",
                                  "run.abandoned",
                                  "task.created",
                                  "task.completed",
                                  "task.expired",
                                  "operation.succeeded",
                                  "operation.failed",
                                  "operation.abandoned",
                                  "knowledge.corrected",
                                  "extraction.completed",
                                  "review.settled",
                                  "batch.admitted"
                                ]
                              }
                            },
                            "active": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "tenantId",
                            "url",
                            "events",
                            "active",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "webhook"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "Webhook_delete",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "Webhook_listDeliveries",
        "tags": [
          "Webhook"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "deliveries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "registrationId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "tenantId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "projectId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "event": {
                                "type": "string",
                                "enum": [
                                  "run.created",
                                  "run.completed",
                                  "run.failed",
                                  "run.abandoned",
                                  "task.created",
                                  "task.completed",
                                  "task.expired",
                                  "operation.succeeded",
                                  "operation.failed",
                                  "operation.abandoned",
                                  "knowledge.corrected",
                                  "extraction.completed",
                                  "review.settled",
                                  "batch.admitted"
                                ]
                              },
                              "payload": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "delivered",
                                  "failed"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "lastAttemptAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "responseStatus": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "errorMessage": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "registrationId",
                              "tenantId",
                              "event",
                              "payload",
                              "status",
                              "attempts",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "deliveries"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workflows/inbox": {
      "get": {
        "operationId": "Workflow_inbox",
        "tags": [
          "Workflow"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "runId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "runTitle": {
                                "type": "string"
                              },
                              "runState": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "active",
                                  "closed",
                                  "failed",
                                  "abandoned"
                                ]
                              },
                              "actorId": {
                                "type": "string"
                              },
                              "waitingOnUserId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "pendingDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "pendingExternalDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "deadLetteredDeliveryCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "latestDeliveryReceivedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "latestDeliverySourceKind": {
                                "type": "string",
                                "enum": [
                                  "initial_start",
                                  "user_message",
                                  "human_response",
                                  "child_run_result",
                                  "schedule_fire",
                                  "external_event",
                                  "cancel_run",
                                  "cancel_wait",
                                  "manual_resume",
                                  "wait_timeout",
                                  "recovery_resume",
                                  "knowledge_event"
                                ]
                              },
                              "latestDeliverySourceRef": {
                                "type": "string"
                              },
                              "latestDeliveryLastError": {
                                "type": "string"
                              },
                              "latestDeliveryPayload": {},
                              "requiresAttention": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "runId",
                              "runTitle",
                              "runState",
                              "actorId",
                              "pendingDeliveryCount",
                              "pendingExternalDeliveryCount",
                              "deadLetteredDeliveryCount",
                              "requiresAttention"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workflows/health": {
      "get": {
        "operationId": "Workflow_health",
        "tags": [
          "Workflow"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "health": {
                          "type": "object",
                          "properties": {
                            "waitingOnHumanCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "pendingDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "deadLetteredDeliveryCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "runsNeedingAttentionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "waitingOnHumanCount",
                            "pendingDeliveryCount",
                            "deadLetteredDeliveryCount",
                            "runsNeedingAttentionCount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "health"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "Workspace_list",
        "tags": [
          "Workspace"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "description": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "defaultBranchId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdByRunId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "defaultBranchId",
                              "createdByRunId",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "workspaces"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Workspace_create",
        "tags": [
          "Workspace"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "branchName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "defaultBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdByRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "description",
                            "defaultBranchId",
                            "createdByRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "defaultBranch": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "workspace",
                        "defaultBranch"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}": {
      "get": {
        "operationId": "Workspace_get",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "defaultBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdByRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "description",
                            "defaultBranchId",
                            "createdByRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "workspace"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branches": {
      "get": {
        "operationId": "Workspace_listBranches",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "branches": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "workspaceId": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "merged",
                                  "abandoned"
                                ]
                              },
                              "baseBranchId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "baseCheckpointId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mergedIntoBranchId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mergedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "headCheckpointId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "activeAttachmentId": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "writeLeaseRunId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "writeLeaseExpiresAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              }
                            },
                            "required": [
                              "id",
                              "workspaceId",
                              "name",
                              "status",
                              "baseBranchId",
                              "baseCheckpointId",
                              "mergedIntoBranchId",
                              "headCheckpointId",
                              "activeAttachmentId",
                              "writeLeaseRunId",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "branches"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "Workspace_createBranch",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "baseBranchId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "branch": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "branch"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branches/{branchId}": {
      "get": {
        "operationId": "Workspace_getBranch",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "branchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "branch": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "branch"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branches/{branchId}/diff": {
      "post": {
        "operationId": "Workspace_diffBranch",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "branchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "targetBranchId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "targetBranchId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "diff": {
                          "type": "object",
                          "properties": {
                            "sourceBranchId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "targetBranchId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "sourceHeadCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "targetHeadCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sourceBaseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "fastForwardable": {
                              "type": "boolean"
                            },
                            "changed": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "sourceBranchId",
                            "targetBranchId",
                            "sourceHeadCheckpointId",
                            "targetHeadCheckpointId",
                            "sourceBaseCheckpointId",
                            "fastForwardable",
                            "changed"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "diff"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branches/{branchId}/merge": {
      "post": {
        "operationId": "Workspace_mergeBranch",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "branchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "targetBranchId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "fast_forward_only",
                      "three_way_merge",
                      "manual_conflict"
                    ]
                  }
                },
                "required": [
                  "targetBranchId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "target": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "source",
                        "target"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branches/{branchId}/abandon": {
      "post": {
        "operationId": "Workspace_abandonBranch",
        "tags": [
          "Workspace"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "branchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "branch": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1
                            },
                            "workspaceId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "merged",
                                "abandoned"
                              ]
                            },
                            "baseBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "baseCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedIntoBranchId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mergedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "headCheckpointId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "activeAttachmentId": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseRunId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "writeLeaseExpiresAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "name",
                            "status",
                            "baseBranchId",
                            "baseCheckpointId",
                            "mergedIntoBranchId",
                            "headCheckpointId",
                            "activeAttachmentId",
                            "writeLeaseRunId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "branch"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{runId}/stream": {
      "get": {
        "operationId": "Run_stream",
        "tags": [
          "Run"
        ],
        "summary": "Stream a run (resumable SSE, or WebSocket on Upgrade)",
        "description": "Content-negotiated. With `Upgrade: websocket`, returns the live Durable-Object stream. Otherwise returns a resumable Server-Sent Events stream: each event id is the RunMessage `sequence`; reconnect with `Last-Event-ID` to replay from a cursor. A dropped connection never cancels the run. The stream ends with a terminal `status` event.",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "Resume cursor — a prior RunMessage `sequence`. The stream replays messages after this sequence, then tails live.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "Upgrade",
            "in": "header",
            "required": false,
            "description": "Set to `websocket` for the Durable-Object live stream instead of SSE.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of `message` events ending in a `status` event.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Organization-scoped API key. Use it for every operation NOT under /v1/brains/{brainId}/connections/{connectionId}/... — those authenticate with a Brain Connection credential instead (see `connectionBearer`). Sending the org key to a Connection endpoint, or a Connection credential to an org endpoint, is always rejected; the two are never interchangeable. A `nsk_` management key is also accepted as `Authorization: Bearer <key>` — the prefix, not the header, decides which plane a bearer token belongs to. On the v2 Brain surface (/v1/brains/{handle}/...) it is the management key, and a Brain key (`brainKey`) is the scoped alternative — there, the two ARE alternatives."
      },
      "brainKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Brain key (`nbk_…`), returned exactly once when it is minted (`POST /v1/brains/{handle}/keys`) or rotated. Reaches ONE Brain and carries only the capabilities it was minted with (`read`, `write`, `review`, `admin`). Anywhere it is listed, the org management key (`apiKey`) is accepted too and carries every capability on every Brain in the organization — the two are alternatives on the v2 Brain surface, not on the v1 Connection surface (see `connectionBearer`). Capability is not the same as ownership: a read RECEIPT is readable only by the key that committed it, so the management key cannot fetch one a Brain key produced (see the receipt operations). Creating a Brain, deleting one, listing them, and minting or revoking keys accept the management key only: no capability would make a Brain key correct for issuing the credentials this plane authenticates with. Sending both credentials on one request is rejected."
      },
      "connectionBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Brain Connection credential, shown once when the Connection is created (`POST /v1/brains/{brainId}/connections`) or rotated. Scoped to exactly one Brain Connection and carries that Connection's own capabilities (`read`, `query`, `submit_evidence`, `submit_mutations`, `request_context`, `review`, `policy_admin`, `access_admin`) — not the org's. Every /v1/brains/{brainId}/connections/{connectionId}/... operation requires it; the org API key is rejected here."
      }
    },
    "parameters": {
      "OrganizationId": {
        "name": "x-organization-id",
        "in": "header",
        "required": false,
        "description": "Target organization (tenant). Required for API keys whose user belongs to more than one organization; otherwise inferred.",
        "schema": {
          "type": "string"
        }
      },
      "ProjectId": {
        "name": "x-project-id",
        "in": "header",
        "required": false,
        "description": "Scope the request to a specific project (validated against the tenant; unknown or foreign ids return 404 not_found). Absent → the organization's default project. Takes precedence over x-project-slug when both are sent.",
        "schema": {
          "type": "string"
        }
      },
      "ProjectSlug": {
        "name": "x-project-slug",
        "in": "header",
        "required": false,
        "description": "Scope the request to a project by slug (validated against the tenant; unknown slugs return 404 not_found). Ignored when x-project-id is present.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error envelope.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "kind",
              "message"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "validation",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "rate_limited",
                  "internal",
                  "unavailable"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
